allyhub 0.9.0 → 0.11.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 (582) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/commands/auth.js +4 -4
  3. package/dist/commands/cloud-tools.js +11 -11
  4. package/dist/commands/dev.js +2 -2
  5. package/dist/commands/frames/compare.js +2 -2
  6. package/dist/commands/frames/piece.js +1 -1
  7. package/dist/commands/frames/report.js +2 -0
  8. package/dist/commands/frames.js +11 -9
  9. package/dist/commands/index.js +1 -1
  10. package/dist/commands/inspect/common.js +4 -2
  11. package/dist/commands/inspect/facts.js +3 -3
  12. package/dist/commands/inspect/layout.js +1 -1
  13. package/dist/commands/orgs.js +2 -2
  14. package/dist/commands/render.js +2 -2
  15. package/dist/help.js +4 -4
  16. package/dist/main.js +8 -7
  17. package/dist/node_modules/@allyhub/3d-extension/dist/stage-routes.js +1 -1
  18. package/dist/node_modules/@allyhub/3d-extension/package.json +34 -2
  19. package/dist/node_modules/@allyhub/audio/package.json +1 -1
  20. package/dist/node_modules/@allyhub/browser/dist/emoji.d.ts +29 -0
  21. package/dist/node_modules/@allyhub/browser/dist/emoji.js +57 -0
  22. package/dist/node_modules/@allyhub/browser/dist/picture.d.ts +18 -0
  23. package/dist/node_modules/@allyhub/browser/dist/picture.js +2 -0
  24. package/dist/node_modules/@allyhub/browser/package.json +9 -1
  25. package/dist/node_modules/@allyhub/build/dist/index.d.ts +1 -0
  26. package/dist/node_modules/@allyhub/build/dist/index.js +1 -1
  27. package/dist/node_modules/@allyhub/build/dist/kind-build.d.ts +7 -0
  28. package/dist/node_modules/@allyhub/build/dist/made-notes.d.ts +9 -0
  29. package/dist/node_modules/@allyhub/build/dist/made-notes.js +2 -0
  30. package/dist/node_modules/@allyhub/build/dist/project-tool.d.ts +17 -0
  31. package/dist/node_modules/@allyhub/build/dist/stage-route.d.ts +7 -0
  32. package/dist/node_modules/@allyhub/build/package.json +1 -1
  33. package/dist/node_modules/@allyhub/canvas-extension/package.json +2 -1
  34. package/dist/node_modules/@allyhub/canvas-extension/skills/allyhub/references/canvas.md +4 -24
  35. package/dist/node_modules/@allyhub/canvas-model/package.json +1 -1
  36. package/dist/node_modules/@allyhub/chart/dist/chart-xml.js +2 -2
  37. package/dist/node_modules/@allyhub/chart/dist/chart.js +1 -1
  38. package/dist/node_modules/@allyhub/chart/package.json +1 -1
  39. package/dist/node_modules/@allyhub/check/package.json +1 -1
  40. package/dist/node_modules/@allyhub/cloud/dist/client.d.ts +10 -0
  41. package/dist/node_modules/@allyhub/cloud/dist/client.js +1 -1
  42. package/dist/node_modules/@allyhub/cloud/dist/config.d.ts +9 -0
  43. package/dist/node_modules/@allyhub/cloud/dist/config.js +1 -1
  44. package/dist/node_modules/@allyhub/cloud/dist/credentials.d.ts +4 -4
  45. package/dist/node_modules/@allyhub/cloud/dist/credentials.js +2 -2
  46. package/dist/node_modules/@allyhub/cloud/dist/device.d.ts +12 -0
  47. package/dist/node_modules/@allyhub/cloud/dist/device.js +2 -0
  48. package/dist/node_modules/@allyhub/cloud/package.json +1 -1
  49. package/dist/node_modules/@allyhub/components/package.json +1 -1
  50. package/dist/node_modules/@allyhub/components/r/callout.json +1 -1
  51. package/dist/node_modules/@allyhub/components/src/callout.ts +98 -13
  52. package/dist/node_modules/@allyhub/dev-server/dist/exports.js +1 -1
  53. package/dist/node_modules/@allyhub/dev-server/dist/index.js +1 -1
  54. package/dist/node_modules/@allyhub/dev-server/dist/inputs.js +2 -0
  55. package/dist/node_modules/@allyhub/dev-server/dist/live.js +1 -1
  56. package/dist/node_modules/@allyhub/dev-server/dist/pages.js +2 -0
  57. package/dist/node_modules/@allyhub/dev-server/dist/ports.js +2 -0
  58. package/dist/node_modules/@allyhub/dev-server/dist/project.js +1 -1
  59. package/dist/node_modules/@allyhub/dev-server/dist/record.js +1 -1
  60. package/dist/node_modules/@allyhub/dev-server/dist/respond.js +2 -0
  61. package/dist/node_modules/@allyhub/dev-server/dist/reveal.js +1 -1
  62. package/dist/node_modules/@allyhub/dev-server/dist/routes.js +1 -1
  63. package/dist/node_modules/@allyhub/dev-server/dist/server.js +2 -2
  64. package/dist/node_modules/@allyhub/dev-server/dist/tools.js +1 -1
  65. package/dist/node_modules/@allyhub/dev-server/dist/watcher.js +1 -1
  66. package/dist/node_modules/@allyhub/dev-server/package.json +1 -1
  67. package/dist/node_modules/@allyhub/diagnostics/dist/problem.d.ts +7 -0
  68. package/dist/node_modules/@allyhub/diagnostics/package.json +1 -1
  69. package/dist/node_modules/@allyhub/doc/dist/captions.js +1 -1
  70. package/dist/node_modules/@allyhub/doc/dist/docx.js +4 -4
  71. package/dist/node_modules/@allyhub/doc/dist/html.js +51 -92
  72. package/dist/node_modules/@allyhub/doc/dist/model.js +1 -1
  73. package/dist/node_modules/@allyhub/doc/dist/page.js +1 -1
  74. package/dist/node_modules/@allyhub/doc/dist/paper.js +1 -1
  75. package/dist/node_modules/@allyhub/doc/dist/table.js +1 -1
  76. package/dist/node_modules/@allyhub/doc/dist/write.js +22 -22
  77. package/dist/node_modules/@allyhub/doc/package.json +1 -1
  78. package/dist/node_modules/@allyhub/doc-extension/dist/export.js +1 -1
  79. package/dist/node_modules/@allyhub/doc-extension/package.json +19 -6
  80. package/dist/node_modules/@allyhub/doc-print/dist/pages.js +5 -5
  81. package/dist/node_modules/@allyhub/doc-print/dist/print.js +10 -10
  82. package/dist/node_modules/@allyhub/doc-print/package.json +1 -1
  83. package/dist/node_modules/@allyhub/export/dist/export.js +1 -1
  84. package/dist/node_modules/@allyhub/export/package.json +1 -1
  85. package/dist/node_modules/@allyhub/extension-api/package.json +1 -1
  86. package/dist/node_modules/@allyhub/extension-host/dist/points.js +1 -1
  87. package/dist/node_modules/@allyhub/extension-host/package.json +1 -1
  88. package/dist/node_modules/@allyhub/formats/dist/data/faces.d.ts +1 -1
  89. package/dist/node_modules/@allyhub/formats/dist/data/sheet.d.ts +87 -1
  90. package/dist/node_modules/@allyhub/formats/dist/data/sheet.js +1 -1
  91. package/dist/node_modules/@allyhub/formats/dist/data/slides.d.ts +89 -0
  92. package/dist/node_modules/@allyhub/formats/dist/data/slides.js +1 -1
  93. package/dist/node_modules/@allyhub/formats/dist/note-shape.d.ts +20 -0
  94. package/dist/node_modules/@allyhub/formats/dist/note-shape.js +1 -1
  95. package/dist/node_modules/@allyhub/formats/dist/schemas.d.ts +50 -0
  96. package/dist/node_modules/@allyhub/formats/package.json +1 -1
  97. package/dist/node_modules/@allyhub/i18n/package.json +1 -1
  98. package/dist/node_modules/@allyhub/image-draw/package.json +1 -1
  99. package/dist/node_modules/@allyhub/image-extension/dist/export.js +4 -1
  100. package/dist/node_modules/@allyhub/image-extension/package.json +16 -6
  101. package/dist/node_modules/@allyhub/image-extension/skills/allyhub/references/images.md +7 -39
  102. package/dist/node_modules/@allyhub/image-measure/package.json +1 -1
  103. package/dist/node_modules/@allyhub/image-psd/package.json +1 -1
  104. package/dist/node_modules/@allyhub/image-render/package.json +1 -1
  105. package/dist/node_modules/@allyhub/image-runtime/package.json +1 -1
  106. package/dist/node_modules/@allyhub/image-sdk/package.json +1 -1
  107. package/dist/node_modules/@allyhub/jobs/package.json +1 -1
  108. package/dist/node_modules/@allyhub/linkedin-extension/LICENSE +241 -0
  109. package/dist/node_modules/@allyhub/linkedin-extension/dist/article-build.js +2 -0
  110. package/dist/node_modules/@allyhub/linkedin-extension/dist/article-kind.js +2 -0
  111. package/dist/node_modules/@allyhub/linkedin-extension/dist/build-plugins.js +2 -0
  112. package/dist/node_modules/@allyhub/linkedin-extension/dist/build.js +5 -0
  113. package/dist/node_modules/@allyhub/linkedin-extension/dist/media.js +2 -0
  114. package/dist/node_modules/@allyhub/linkedin-extension/dist/stage-module.js +82 -0
  115. package/dist/node_modules/@allyhub/linkedin-extension/dist/stage.js +2 -0
  116. package/dist/node_modules/@allyhub/linkedin-extension/dist/workspace.js +2 -0
  117. package/dist/node_modules/@allyhub/linkedin-extension/package.json +287 -0
  118. package/dist/node_modules/@allyhub/linkedin-extension/skills/allyhub/references/linkedin.md +12 -0
  119. package/dist/node_modules/@allyhub/linkedin-model/LICENSE +241 -0
  120. package/dist/node_modules/@allyhub/linkedin-model/dist/article-check.js +5 -0
  121. package/dist/node_modules/@allyhub/linkedin-model/dist/article.js +3 -0
  122. package/dist/node_modules/@allyhub/linkedin-model/dist/check.js +2 -0
  123. package/dist/node_modules/@allyhub/linkedin-model/dist/count.js +3 -0
  124. package/dist/node_modules/@allyhub/linkedin-model/dist/edit.js +3 -0
  125. package/dist/node_modules/@allyhub/linkedin-model/dist/html.js +19 -0
  126. package/dist/node_modules/@allyhub/linkedin-model/dist/index.js +2 -0
  127. package/dist/node_modules/@allyhub/linkedin-model/dist/limits.js +2 -0
  128. package/dist/node_modules/@allyhub/linkedin-model/dist/little.js +2 -0
  129. package/dist/node_modules/@allyhub/linkedin-model/dist/post.js +2 -0
  130. package/dist/node_modules/@allyhub/linkedin-model/dist/requests.js +2 -0
  131. package/dist/node_modules/@allyhub/linkedin-model/package.json +14 -0
  132. package/dist/node_modules/@allyhub/linkedin-view/LICENSE +241 -0
  133. package/dist/node_modules/@allyhub/linkedin-view/dist/article.js +2 -0
  134. package/dist/node_modules/@allyhub/linkedin-view/dist/fold.js +3 -0
  135. package/dist/node_modules/@allyhub/linkedin-view/dist/index.js +2 -0
  136. package/dist/node_modules/@allyhub/linkedin-view/dist/post.js +2 -0
  137. package/dist/node_modules/@allyhub/linkedin-view/dist/stage.js +2 -0
  138. package/dist/node_modules/@allyhub/linkedin-view/dist/text.js +2 -0
  139. package/dist/node_modules/@allyhub/linkedin-view/package.json +21 -0
  140. package/dist/node_modules/@allyhub/linkedin-view/src/style.css +600 -0
  141. package/dist/node_modules/@allyhub/measure/package.json +1 -1
  142. package/dist/node_modules/@allyhub/media/package.json +1 -1
  143. package/dist/node_modules/@allyhub/media-extension/dist/vision/faces.js +1 -1
  144. package/dist/node_modules/@allyhub/media-extension/package.json +7 -4
  145. package/dist/node_modules/@allyhub/model/package.json +1 -1
  146. package/dist/node_modules/@allyhub/ooxml/dist/geometry/index.js +1 -1
  147. package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
  148. package/dist/node_modules/@allyhub/piece/dist/layer.d.ts +2 -0
  149. package/dist/node_modules/@allyhub/piece/dist/layout.d.ts +16 -0
  150. package/dist/node_modules/@allyhub/piece/dist/page/index.d.ts +1 -1
  151. package/dist/node_modules/@allyhub/piece/dist/page/index.js +1 -1
  152. package/dist/node_modules/@allyhub/piece/dist/page/locate.d.ts +14 -1
  153. package/dist/node_modules/@allyhub/piece/dist/page/locate.js +1 -1
  154. package/dist/node_modules/@allyhub/piece/dist/stage.d.ts +18 -0
  155. package/dist/node_modules/@allyhub/piece/package.json +1 -1
  156. package/dist/node_modules/@allyhub/project/dist/version.js +1 -1
  157. package/dist/node_modules/@allyhub/project/package.json +1 -1
  158. package/dist/node_modules/@allyhub/protocol/dist/account.d.ts +140 -0
  159. package/dist/node_modules/@allyhub/protocol/dist/account.js +1 -1
  160. package/dist/node_modules/@allyhub/protocol/dist/auth.d.ts +19 -1
  161. package/dist/node_modules/@allyhub/protocol/dist/auth.js +1 -1
  162. package/dist/node_modules/@allyhub/protocol/dist/cloud.d.ts +157 -0
  163. package/dist/node_modules/@allyhub/protocol/dist/cloud.js +1 -1
  164. package/dist/node_modules/@allyhub/protocol/dist/editor.d.ts +10 -2
  165. package/dist/node_modules/@allyhub/protocol/dist/editor.js +1 -1
  166. package/dist/node_modules/@allyhub/protocol/dist/frame.d.ts +101 -186
  167. package/dist/node_modules/@allyhub/protocol/dist/frame.js +1 -1
  168. package/dist/node_modules/@allyhub/protocol/dist/mail.d.ts +1 -0
  169. package/dist/node_modules/@allyhub/protocol/dist/mail.js +1 -1
  170. package/dist/node_modules/@allyhub/protocol/dist/notes.d.ts +92 -94
  171. package/dist/node_modules/@allyhub/protocol/dist/notes.js +1 -1
  172. package/dist/node_modules/@allyhub/protocol/dist/snapshots.d.ts +17 -0
  173. package/dist/node_modules/@allyhub/protocol/dist/snapshots.js +1 -1
  174. package/dist/node_modules/@allyhub/protocol/dist/teams.d.ts +7 -0
  175. package/dist/node_modules/@allyhub/protocol/dist/teams.js +1 -1
  176. package/dist/node_modules/@allyhub/protocol/dist/tools.d.ts +15 -3
  177. package/dist/node_modules/@allyhub/protocol/dist/tools.js +1 -1
  178. package/dist/node_modules/@allyhub/protocol/package.json +1 -1
  179. package/dist/node_modules/@allyhub/registry/package.json +1 -1
  180. package/dist/node_modules/@allyhub/render/dist/encode.js +1 -1
  181. package/dist/node_modules/@allyhub/render/dist/index.js +1 -1
  182. package/dist/node_modules/@allyhub/render/dist/look.js +1 -1
  183. package/dist/node_modules/@allyhub/render/dist/render.js +2 -2
  184. package/dist/node_modules/@allyhub/render/package.json +1 -1
  185. package/dist/node_modules/@allyhub/report-extension/LICENSE +241 -0
  186. package/dist/node_modules/@allyhub/report-extension/dist/build.js +2 -0
  187. package/dist/node_modules/@allyhub/report-extension/dist/check.js +3 -0
  188. package/dist/node_modules/@allyhub/report-extension/dist/cli/find.js +2 -0
  189. package/dist/node_modules/@allyhub/report-extension/dist/cli/index.js +5 -0
  190. package/dist/node_modules/@allyhub/report-extension/dist/cli/picture.js +2 -0
  191. package/dist/node_modules/@allyhub/report-extension/dist/export.js +2 -0
  192. package/dist/node_modules/@allyhub/report-extension/dist/inline.js +58 -0
  193. package/dist/node_modules/@allyhub/report-extension/dist/page.js +21 -0
  194. package/dist/node_modules/@allyhub/report-extension/dist/project-tools.js +21 -0
  195. package/dist/node_modules/@allyhub/report-extension/dist/styles.js +5 -0
  196. package/dist/node_modules/@allyhub/report-extension/dist/theme.js +2 -0
  197. package/dist/node_modules/@allyhub/report-extension/dist/tools.js +2 -0
  198. package/dist/node_modules/@allyhub/report-extension/dist/workspace.js +2 -0
  199. package/dist/node_modules/@allyhub/report-extension/package.json +182 -0
  200. package/dist/node_modules/@allyhub/report-extension/styles/allyhub/STYLE.md +132 -0
  201. package/dist/node_modules/@allyhub/report-extension/styles/allyhub/style.css +105 -0
  202. package/dist/node_modules/@allyhub/report-extension/styles/allyhub/style.json +17 -0
  203. package/dist/node_modules/@allyhub/report-extension/styles/allyhub/tokens.js +38 -0
  204. package/dist/node_modules/@allyhub/runtime/dist/compose.js +1 -1
  205. package/dist/node_modules/@allyhub/runtime/dist/embed.js +1 -1
  206. package/dist/node_modules/@allyhub/runtime/dist/player/clips.js +1 -1
  207. package/dist/node_modules/@allyhub/runtime/dist/player/player.js +1 -1
  208. package/dist/node_modules/@allyhub/runtime/package.json +1 -1
  209. package/dist/node_modules/@allyhub/runtimes/package.json +1 -1
  210. package/dist/node_modules/@allyhub/scaffold/package.json +1 -1
  211. package/dist/node_modules/@allyhub/scenery/dist/index.d.ts +2 -2
  212. package/dist/node_modules/@allyhub/scenery/dist/index.js +1 -1
  213. package/dist/node_modules/@allyhub/scenery/dist/moire.d.ts +45 -5
  214. package/dist/node_modules/@allyhub/scenery/dist/moire.js +2 -2
  215. package/dist/node_modules/@allyhub/scenery/dist/phone.d.ts +4 -3
  216. package/dist/node_modules/@allyhub/scenery/dist/phone.js +1 -1
  217. package/dist/node_modules/@allyhub/scenery/package.json +1 -1
  218. package/dist/node_modules/@allyhub/scenery-host/dist/layer/grade.d.ts +7 -0
  219. package/dist/node_modules/@allyhub/scenery-host/dist/layer/grade.js +2 -0
  220. package/dist/node_modules/@allyhub/scenery-host/dist/layer/index.d.ts +4 -3
  221. package/dist/node_modules/@allyhub/scenery-host/dist/layer/index.js +1 -1
  222. package/dist/node_modules/@allyhub/scenery-host/dist/layer/screens.d.ts +1 -1
  223. package/dist/node_modules/@allyhub/scenery-host/dist/layer/screens.js +1 -1
  224. package/dist/node_modules/@allyhub/scenery-host/dist/measure/facts.js +1 -1
  225. package/dist/node_modules/@allyhub/scenery-host/dist/page/screens.d.ts +8 -0
  226. package/dist/node_modules/@allyhub/scenery-host/dist/page/screens.js +1 -1
  227. package/dist/node_modules/@allyhub/scenery-host/dist/viewer.d.ts +6 -0
  228. package/dist/node_modules/@allyhub/scenery-host/dist/viewer.js +1 -1
  229. package/dist/node_modules/@allyhub/scenery-host/package.json +1 -1
  230. package/dist/node_modules/@allyhub/sheet/dist/calc/coerce.js +1 -1
  231. package/dist/node_modules/@allyhub/sheet/dist/calc/engine.js +1 -1
  232. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/criteria.js +1 -1
  233. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/date.js +1 -1
  234. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/define.js +1 -1
  235. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/info.js +1 -1
  236. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/kernels.js +1 -1
  237. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/lookup.js +1 -1
  238. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/maths.js +1 -1
  239. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/text.js +1 -1
  240. package/dist/node_modules/@allyhub/sheet/dist/calc/indexes.js +1 -1
  241. package/dist/node_modules/@allyhub/sheet/dist/calc/types.js +1 -1
  242. package/dist/node_modules/@allyhub/sheet/dist/chart.js +1 -1
  243. package/dist/node_modules/@allyhub/sheet/dist/export.js +2 -4
  244. package/dist/node_modules/@allyhub/sheet/dist/formula/move.js +1 -1
  245. package/dist/node_modules/@allyhub/sheet/dist/formula/parse.js +1 -1
  246. package/dist/node_modules/@allyhub/sheet/dist/formula/print.js +1 -1
  247. package/dist/node_modules/@allyhub/sheet/dist/index.js +1 -1
  248. package/dist/node_modules/@allyhub/sheet/dist/inspect.js +1 -1
  249. package/dist/node_modules/@allyhub/sheet/dist/printed.js +2 -0
  250. package/dist/node_modules/@allyhub/sheet/dist/values.js +1 -1
  251. package/dist/node_modules/@allyhub/sheet/dist/workbook.js +1 -1
  252. package/dist/node_modules/@allyhub/sheet/dist/write.js +15 -15
  253. package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.js +1 -1
  254. package/dist/node_modules/@allyhub/sheet/dist/xlsx/formula.js +2 -2
  255. package/dist/node_modules/@allyhub/sheet/dist/xlsx/import.js +1 -1
  256. package/dist/node_modules/@allyhub/sheet/dist/xlsx/read.js +2 -2
  257. package/dist/node_modules/@allyhub/sheet/dist/xlsx/sax.js +3 -1
  258. package/dist/node_modules/@allyhub/sheet/dist/xlsx/styles.js +1 -1
  259. package/dist/node_modules/@allyhub/sheet/dist/xlsx/write.js +1 -1
  260. package/dist/node_modules/@allyhub/sheet/dist/xlsx/xml.js +3 -2
  261. package/dist/node_modules/@allyhub/sheet/package.json +1 -1
  262. package/dist/node_modules/@allyhub/sheet-extension/dist/export.js +2 -6
  263. package/dist/node_modules/@allyhub/sheet-extension/package.json +24 -9
  264. package/dist/node_modules/@allyhub/slides-core/dist/api.js +2 -2
  265. package/dist/node_modules/@allyhub/slides-core/dist/capabilities.js +1 -1
  266. package/dist/node_modules/@allyhub/slides-core/dist/enums.js +1 -1
  267. package/dist/node_modules/@allyhub/slides-core/dist/measure.js +1 -1
  268. package/dist/node_modules/@allyhub/slides-core/dist/resolve.js +1 -1
  269. package/dist/node_modules/@allyhub/slides-core/dist/sdk.js +1 -1
  270. package/dist/node_modules/@allyhub/slides-core/package.json +1 -1
  271. package/dist/node_modules/@allyhub/slides-extension/dist/export.js +1 -1
  272. package/dist/node_modules/@allyhub/slides-extension/package.json +22 -16
  273. package/dist/node_modules/@allyhub/slides-pptx/dist/import/code.js +2 -2
  274. package/dist/node_modules/@allyhub/slides-pptx/dist/import/index.js +2 -2
  275. package/dist/node_modules/@allyhub/slides-pptx/dist/read/common.js +1 -1
  276. package/dist/node_modules/@allyhub/slides-pptx/dist/read/shapes.js +1 -1
  277. package/dist/node_modules/@allyhub/slides-pptx/dist/read/text.js +1 -1
  278. package/dist/node_modules/@allyhub/slides-pptx/dist/shapes.js +1 -1
  279. package/dist/node_modules/@allyhub/slides-pptx/dist/text.js +1 -1
  280. package/dist/node_modules/@allyhub/slides-pptx/dist/write.js +2 -2
  281. package/dist/node_modules/@allyhub/slides-pptx/dist/xml.js +1 -1
  282. package/dist/node_modules/@allyhub/slides-pptx/package.json +1 -1
  283. package/dist/node_modules/@allyhub/slides-runtime/dist/draw.js +2 -2
  284. package/dist/node_modules/@allyhub/slides-runtime/dist/load.js +5 -5
  285. package/dist/node_modules/@allyhub/slides-runtime/package.json +1 -1
  286. package/dist/node_modules/@allyhub/stage/package.json +1 -1
  287. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/400-italic.css +19 -0
  288. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/400.css +19 -0
  289. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/700-italic.css +19 -0
  290. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/700.css +19 -0
  291. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/LICENSE +93 -0
  292. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/cambria.css +76 -0
  293. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-400-italic.woff2 +0 -0
  294. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-400-normal.woff2 +0 -0
  295. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-700-italic.woff2 +0 -0
  296. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-700-normal.woff2 +0 -0
  297. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-ext-400-italic.woff2 +0 -0
  298. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-ext-400-normal.woff2 +0 -0
  299. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-ext-700-italic.woff2 +0 -0
  300. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-ext-700-normal.woff2 +0 -0
  301. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/400-italic.css +79 -0
  302. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/400.css +79 -0
  303. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/700-italic.css +79 -0
  304. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/700.css +79 -0
  305. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/LICENSE +93 -0
  306. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/courier-new.css +316 -0
  307. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-400-italic.woff2 +0 -0
  308. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-400-normal.woff2 +0 -0
  309. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-700-italic.woff2 +0 -0
  310. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-700-normal.woff2 +0 -0
  311. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-ext-400-italic.woff2 +0 -0
  312. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-ext-400-normal.woff2 +0 -0
  313. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-ext-700-italic.woff2 +0 -0
  314. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-ext-700-normal.woff2 +0 -0
  315. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-400-italic.woff2 +0 -0
  316. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-400-normal.woff2 +0 -0
  317. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-700-italic.woff2 +0 -0
  318. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-700-normal.woff2 +0 -0
  319. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-ext-400-italic.woff2 +0 -0
  320. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-ext-400-normal.woff2 +0 -0
  321. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-ext-700-italic.woff2 +0 -0
  322. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-ext-700-normal.woff2 +0 -0
  323. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-hebrew-400-italic.woff2 +0 -0
  324. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-hebrew-400-normal.woff2 +0 -0
  325. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-hebrew-700-italic.woff2 +0 -0
  326. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-hebrew-700-normal.woff2 +0 -0
  327. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-400-italic.woff2 +0 -0
  328. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-400-normal.woff2 +0 -0
  329. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-700-italic.woff2 +0 -0
  330. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-700-normal.woff2 +0 -0
  331. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-ext-400-italic.woff2 +0 -0
  332. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-ext-400-normal.woff2 +0 -0
  333. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-ext-700-italic.woff2 +0 -0
  334. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-ext-700-normal.woff2 +0 -0
  335. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-vietnamese-400-italic.woff2 +0 -0
  336. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-vietnamese-400-normal.woff2 +0 -0
  337. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-vietnamese-700-italic.woff2 +0 -0
  338. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-vietnamese-700-normal.woff2 +0 -0
  339. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/400-italic.css +79 -0
  340. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/400.css +79 -0
  341. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/700-italic.css +79 -0
  342. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/700.css +79 -0
  343. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/LICENSE +93 -0
  344. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-400-italic.woff2 +0 -0
  345. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-400-normal.woff2 +0 -0
  346. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-700-italic.woff2 +0 -0
  347. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-700-normal.woff2 +0 -0
  348. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-ext-400-italic.woff2 +0 -0
  349. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-ext-400-normal.woff2 +0 -0
  350. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-ext-700-italic.woff2 +0 -0
  351. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-ext-700-normal.woff2 +0 -0
  352. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-400-italic.woff2 +0 -0
  353. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-400-normal.woff2 +0 -0
  354. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-700-italic.woff2 +0 -0
  355. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-700-normal.woff2 +0 -0
  356. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-ext-400-italic.woff2 +0 -0
  357. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-ext-400-normal.woff2 +0 -0
  358. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-ext-700-italic.woff2 +0 -0
  359. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-ext-700-normal.woff2 +0 -0
  360. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-hebrew-400-italic.woff2 +0 -0
  361. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-hebrew-400-normal.woff2 +0 -0
  362. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-hebrew-700-italic.woff2 +0 -0
  363. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-hebrew-700-normal.woff2 +0 -0
  364. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-400-italic.woff2 +0 -0
  365. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-400-normal.woff2 +0 -0
  366. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-700-italic.woff2 +0 -0
  367. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-700-normal.woff2 +0 -0
  368. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-ext-400-italic.woff2 +0 -0
  369. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-ext-400-normal.woff2 +0 -0
  370. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-ext-700-italic.woff2 +0 -0
  371. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-ext-700-normal.woff2 +0 -0
  372. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-vietnamese-400-italic.woff2 +0 -0
  373. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-vietnamese-400-normal.woff2 +0 -0
  374. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-vietnamese-700-italic.woff2 +0 -0
  375. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-vietnamese-700-normal.woff2 +0 -0
  376. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/times-new-roman.css +316 -0
  377. package/dist/node_modules/@allyhub/stage-page/dist/host.js +1 -1
  378. package/dist/node_modules/@allyhub/stage-page/dist/install.js +1 -1
  379. package/dist/node_modules/@allyhub/stage-page/dist/runtime/stage.html +3 -0
  380. package/dist/node_modules/@allyhub/stage-page/dist/runtime/stage.js +1 -1
  381. package/dist/node_modules/@allyhub/stage-page/package.json +1 -1
  382. package/dist/node_modules/@allyhub/stage-runtime/dist/runtime.js +18 -18
  383. package/dist/node_modules/@allyhub/stage-runtime/package.json +1 -1
  384. package/dist/node_modules/@allyhub/video-core/dist/schema.js +1 -1
  385. package/dist/node_modules/@allyhub/video-core/package.json +1 -1
  386. package/dist/node_modules/@allyhub/video-extension/dist/export.js +1 -1
  387. package/dist/node_modules/@allyhub/video-extension/package.json +17 -4
  388. package/dist/node_modules/@allyhub/video-measure/dist/version.js +1 -1
  389. package/dist/node_modules/@allyhub/video-measure/package.json +1 -1
  390. package/dist/node_modules/@allyhub/video-sdk/dist/phone.js +1 -1
  391. package/dist/node_modules/@allyhub/video-sdk/package.json +1 -1
  392. package/dist/node_modules/@allyhub/website/package.json +1 -1
  393. package/dist/node_modules/@allyhub/website-extension/dist/held.js +2 -0
  394. package/dist/node_modules/@allyhub/website-extension/dist/preview.js +5 -5
  395. package/dist/node_modules/@allyhub/website-extension/dist/project-tools.js +24 -1
  396. package/dist/node_modules/@allyhub/website-extension/dist/tools.js +1 -1
  397. package/dist/node_modules/@allyhub/website-extension/package.json +49 -2
  398. package/dist/node_modules/@allyhub/x-extension/dist/build.js +4 -3
  399. package/dist/node_modules/@allyhub/x-extension/package.json +43 -15
  400. package/dist/node_modules/@allyhub/x-extension/skills/allyhub/references/x.md +7 -62
  401. package/dist/node_modules/@allyhub/x-model/package.json +1 -1
  402. package/dist/node_modules/@allyhub/x-view/dist/article.js +1 -1
  403. package/dist/node_modules/@allyhub/x-view/dist/index.js +1 -1
  404. package/dist/node_modules/@allyhub/x-view/dist/post.js +2 -2
  405. package/dist/node_modules/@allyhub/x-view/package.json +1 -1
  406. package/dist/package.json +12 -10
  407. package/dist/text/facts-text.js +5 -5
  408. package/dist/text/index.js +1 -1
  409. package/dist/text/long-text.js +4 -0
  410. package/dist/works.js +1 -1
  411. package/editor-web/assets/{abnfDiagram-WEYOIA3C-CN5PiJYY.js → abnfDiagram-WEYOIA3C-BKmMA6gn.js} +1 -1
  412. package/editor-web/assets/{architecture-WOLXFQ4H-BnvZtQYk.js → architecture-WOLXFQ4H-BEFBgb4k.js} +1 -1
  413. package/editor-web/assets/{architectureDiagram-ZHVYKT53-tkcEcFQ8.js → architectureDiagram-ZHVYKT53-_u5YfCjY.js} +1 -1
  414. package/editor-web/assets/{arrow-up-DTP2yVSU.js → arrow-up-B5rJbBv0.js} +1 -1
  415. package/editor-web/assets/article-BUmD3xtR.js +8 -0
  416. package/editor-web/assets/article-DNioBb3p.js +7 -0
  417. package/editor-web/assets/{audio-lines-Ti8-m7H2.js → audio-lines-CzuzsGjI.js} +1 -1
  418. package/editor-web/assets/{blockDiagram-RJAE7QA3-DhqEIpie.js → blockDiagram-RJAE7QA3-DybfaO3Z.js} +1 -1
  419. package/editor-web/assets/bookmark-Dsd3kHJJ.js +1 -0
  420. package/editor-web/assets/button-eGxLxbv9.js +41 -0
  421. package/editor-web/assets/{c4Diagram-XDPPPE54-Bg9G95tl.js → c4Diagram-XDPPPE54-BfqLHB5i.js} +1 -1
  422. package/editor-web/assets/calc-worker-D2pGis6e.js +45 -0
  423. package/editor-web/assets/channel-TNPgFDrw.js +1 -0
  424. package/editor-web/assets/chart-C37xvZT2.js +1 -0
  425. package/editor-web/assets/chart-no-axes-column-BVkeF_Mr.js +1 -0
  426. package/editor-web/assets/{chunk-2E7WHVMD-C8Ve9lAa.js → chunk-2E7WHVMD-BVp1I_d0.js} +1 -1
  427. package/editor-web/assets/{chunk-4EMNKR2T-BDWwPUnT.js → chunk-4EMNKR2T-CTdgWEMr.js} +1 -1
  428. package/editor-web/assets/{chunk-55XCU76K-BQiNPKgx.js → chunk-55XCU76K-7pnsxeaP.js} +1 -1
  429. package/editor-web/assets/{chunk-7S6XSTFO-QoEt-6jf.js → chunk-7S6XSTFO-Dc0Dvkq7.js} +1 -1
  430. package/editor-web/assets/{chunk-AQDTSKZB-BeuwIv0-.js → chunk-AQDTSKZB-VAILIsfx.js} +1 -1
  431. package/editor-web/assets/{chunk-DSNLSHJZ-BHW7sLAz.js → chunk-DSNLSHJZ-CUDx1Rv5.js} +1 -1
  432. package/editor-web/assets/{chunk-HAGFOTED-bbGED0hu.js → chunk-HAGFOTED-DAoEe-dJ.js} +1 -1
  433. package/editor-web/assets/{chunk-HNE4Q36P-FltWp8yo.js → chunk-HNE4Q36P-g0akya12.js} +1 -1
  434. package/editor-web/assets/{chunk-NQOKRVIF-NeQzr6kH.js → chunk-NQOKRVIF-hTGjzXdJ.js} +1 -1
  435. package/editor-web/assets/{chunk-UHW7PFBP-eA4-WUhn.js → chunk-UHW7PFBP-BgLV8BIJ.js} +1 -1
  436. package/editor-web/assets/{chunk-VQ5W62QI-BPPv325z.js → chunk-VQ5W62QI-Bw19OOSD.js} +1 -1
  437. package/editor-web/assets/{chunk-WQQL4CDK-DOCIz7Te.js → chunk-WQQL4CDK-CMST9dyE.js} +1 -1
  438. package/editor-web/assets/{chunk-YZO67HFG-Dc_ihQJi.js → chunk-YZO67HFG-Bbpu36XF.js} +1 -1
  439. package/editor-web/assets/{chunk-ZAUX2LTX-CoqwCPSm.js → chunk-ZAUX2LTX-C48Ri0Gs.js} +1 -1
  440. package/editor-web/assets/{chunk-ZCHMQSOR-CZUQPkJx.js → chunk-ZCHMQSOR-DN1g01Oe.js} +1 -1
  441. package/editor-web/assets/{classDiagram-v2-4MYWR3UA-DUh9c50k.js → classDiagram-v2-4MYWR3UA-U6jbPr2d.js} +1 -1
  442. package/editor-web/assets/collaborator-B1u2td9m.js +1 -0
  443. package/editor-web/assets/createLucideIcon-GFZ_fxLc.js +1 -0
  444. package/editor-web/assets/{cynefin-EF2NZ3EQ-DUTZiog0.js → cynefin-EF2NZ3EQ-gzkai_7-.js} +1 -1
  445. package/editor-web/assets/{cynefinDiagram-WF24UDRP-oAjpfbrU.js → cynefinDiagram-WF24UDRP-DtSekSr6.js} +1 -1
  446. package/editor-web/assets/{dagre-NK4GIZVX-BrKvKCvb.js → dagre-NK4GIZVX-CiUwYVT6.js} +1 -1
  447. package/editor-web/assets/{diagram-CBK3MWTC-GekVRnmm.js → diagram-CBK3MWTC-r9XHCV-k.js} +1 -1
  448. package/editor-web/assets/{diagram-I5XIIV2D-CDd1VFRT.js → diagram-I5XIIV2D-DxVsDZ34.js} +1 -1
  449. package/editor-web/assets/{diagram-ODIL2UCW-535RISTn.js → diagram-ODIL2UCW-B0eNQoHV.js} +1 -1
  450. package/editor-web/assets/{diagram-PFBEJUXE-MXzzKCGG.js → diagram-PFBEJUXE-C7f2MfJT.js} +1 -1
  451. package/editor-web/assets/{diagram-RJA3I4VV-vKVwkQxY.js → diagram-RJA3I4VV-CSXcnvct.js} +1 -1
  452. package/editor-web/assets/{diagram-TYUNFSNR-UwGAiQLx.js → diagram-TYUNFSNR-DXzOD_ii.js} +1 -1
  453. package/editor-web/assets/dist-BGRwhCQO.js +1 -0
  454. package/editor-web/assets/{dist-9ymlIMhr.js → dist-BW4X7BrF.js} +1 -1
  455. package/editor-web/assets/dist-BgDRE85b.js +2 -0
  456. package/editor-web/assets/dist-Blq5nJnU.js +24 -0
  457. package/editor-web/assets/dist-BuWaZ3Y4.js +274 -0
  458. package/editor-web/assets/dist-C1emZ9wX.js +37 -0
  459. package/editor-web/assets/dist-CC7OeU1e.js +6 -0
  460. package/editor-web/assets/dist-CX-fiPSn.js +38 -0
  461. package/editor-web/assets/dist-C_VvG-_9.js +5 -0
  462. package/editor-web/assets/dist-Ce7HrBxv.js +3 -0
  463. package/editor-web/assets/dist-D2k6w-_a.js +1 -0
  464. package/editor-web/assets/dist-DDv_SbKw.js +84 -0
  465. package/editor-web/assets/dist-DEoEO4zs.js +1 -0
  466. package/editor-web/assets/dist-DlDxxPIP.js +16 -0
  467. package/editor-web/assets/dist-Gz6NDS0J.js +4 -0
  468. package/editor-web/assets/{ebnfDiagram-V4P3TTPT-73yGokYa.js → ebnfDiagram-V4P3TTPT-Cs4YRvDD.js} +1 -1
  469. package/editor-web/assets/{elk-QONTBCTQ-BW6V9y6a.js → elk-QONTBCTQ-Bh3LZ9WI.js} +1 -1
  470. package/editor-web/assets/{erDiagram-KYQIGQAA-BPqIJ22h.js → erDiagram-KYQIGQAA-C4vYTYXp.js} +1 -1
  471. package/editor-web/assets/{eventmodeling-K75KTNOO-_VZ8jvuy.js → eventmodeling-K75KTNOO-BN1kkHWS.js} +1 -1
  472. package/editor-web/assets/flowDiagram-IUGLLWBU-B04NGsyi.js +1 -0
  473. package/editor-web/assets/{ganttDiagram-R7GPNTJY-DZ157JN2.js → ganttDiagram-R7GPNTJY-CA1LkkC5.js} +1 -1
  474. package/editor-web/assets/{gitGraph-VSP46ZUC-fmcNL9bq.js → gitGraph-VSP46ZUC-Dy5tA7dG.js} +1 -1
  475. package/editor-web/assets/{gitGraphDiagram-PDYL7XHY-DiZDyksR.js → gitGraphDiagram-PDYL7XHY-hJIB8EkH.js} +1 -1
  476. package/editor-web/assets/hint-B8JpEypy.js +1 -0
  477. package/editor-web/assets/index-CgB5osVc.js +28 -0
  478. package/editor-web/assets/index-Daytem9N.css +2 -0
  479. package/editor-web/assets/{info-OHQRW6UA-V06620kN.js → info-OHQRW6UA-DvzSf7rQ.js} +1 -1
  480. package/editor-web/assets/{infoDiagram-MVDRKAX5-CbIgheWX.js → infoDiagram-MVDRKAX5-BjIMm4Af.js} +1 -1
  481. package/editor-web/assets/{ishikawaDiagram-HPEHV2GE-D5oJQPkG.js → ishikawaDiagram-HPEHV2GE-Bpz71S40.js} +1 -1
  482. package/editor-web/assets/{italic-CDhZKo_q.js → italic-D10w8n6C.js} +1 -1
  483. package/editor-web/assets/{journeyDiagram-BOSHW7O7-BZEv6JI4.js → journeyDiagram-BOSHW7O7-DAB-pZjD.js} +1 -1
  484. package/editor-web/assets/{kanban-definition-FNSA4HC5-CLG1R8y_.js → kanban-definition-FNSA4HC5-cYeyh3P6.js} +1 -1
  485. package/editor-web/assets/katex-5Z2zF-9g.js +257 -0
  486. package/editor-web/assets/link-BC5xK1-1.js +1 -0
  487. package/editor-web/assets/{mermaid-parser.core-DxDwXM7z.js → mermaid-parser.core-req5LE0X.js} +3 -3
  488. package/editor-web/assets/{mermaid.core-tU55ZwVG.js → mermaid.core-zFwZug4C.js} +4 -4
  489. package/editor-web/assets/{mindmap-definition-6OY57UG3-CYf4zzAh.js → mindmap-definition-6OY57UG3-TStWb7DG.js} +1 -1
  490. package/editor-web/assets/minus-DaWs5i8B.js +1 -0
  491. package/editor-web/assets/{packet-JDAUHWVQ-DsHeKYNL.js → packet-JDAUHWVQ-smFhVKcB.js} +1 -1
  492. package/editor-web/assets/palette-BIOudGkm.js +1 -0
  493. package/editor-web/assets/{pegDiagram-ECIUJNBX-CQyh6TTa.js → pegDiagram-ECIUJNBX-DvSNRv0-.js} +1 -1
  494. package/editor-web/assets/{pie-XZMESJXO-3vCIvpNB.js → pie-XZMESJXO-qjaGsBZG.js} +1 -1
  495. package/editor-web/assets/{pieDiagram-GNMPY74T-DF5yGBLn.js → pieDiagram-GNMPY74T-Dd9P-Pdc.js} +1 -1
  496. package/editor-web/assets/play-CrMmPghG.js +1 -0
  497. package/editor-web/assets/progress-DE4C5_3x.js +6 -0
  498. package/editor-web/assets/props-form-CsmDBqzy.js +1 -0
  499. package/editor-web/assets/{quadrantDiagram-D57K4MC3-B7pxlDYP.js → quadrantDiagram-D57K4MC3-h2IIKUUA.js} +1 -1
  500. package/editor-web/assets/{radar-ABXABTNO-cpEA41mL.js → radar-ABXABTNO-DlVrSA1d.js} +1 -1
  501. package/editor-web/assets/{railroad-I3PHUGI6-BLyy5R2c.js → railroad-I3PHUGI6-nFbuLAtc.js} +1 -1
  502. package/editor-web/assets/{railroad-abnf-LNEFI6M7-Y-oyol19.js → railroad-abnf-LNEFI6M7-Daj8h2iV.js} +1 -1
  503. package/editor-web/assets/{railroad-ebnf-DWYD2UWJ-o58wHZsr.js → railroad-ebnf-DWYD2UWJ-eYJyl5PH.js} +1 -1
  504. package/editor-web/assets/{railroad-peg-JR7BVNR7-CcD3PXZ8.js → railroad-peg-JR7BVNR7-BTRhKZQq.js} +1 -1
  505. package/editor-web/assets/{railroadDiagram-Y72NRBL7-BuCC4eyy.js → railroadDiagram-Y72NRBL7-CeLGUjdp.js} +1 -1
  506. package/editor-web/assets/react-WA6wlt8S.js +1 -0
  507. package/editor-web/assets/{repeat-2-C5PCbNsg.js → repeat-2-VQP1EVOZ.js} +1 -1
  508. package/editor-web/assets/{requirementDiagram-EQYSW5RA-Dp-JFGn4.js → requirementDiagram-EQYSW5RA-Dmk9XRM5.js} +1 -1
  509. package/editor-web/assets/row-BRlEWRrK.js +1 -0
  510. package/editor-web/assets/{sankeyDiagram-SY24JHO5-rYuCqEvw.js → sankeyDiagram-SY24JHO5-Yn4zlrAM.js} +1 -1
  511. package/editor-web/assets/schemas-VikZYZIK.js +1 -0
  512. package/editor-web/assets/{sequenceDiagram-BLEHNHQU-DryW8x6d.js → sequenceDiagram-BLEHNHQU-BTRnp_PW.js} +1 -1
  513. package/editor-web/assets/session-Do9AqS38.js +1 -0
  514. package/editor-web/assets/slides-diTEQ3C5.js +1 -0
  515. package/editor-web/assets/snapshots-BUGlKQIB.js +56 -0
  516. package/editor-web/assets/sound-Bj3o9_Fa.js +1 -0
  517. package/editor-web/assets/split-CNU1RHcX.js +3 -0
  518. package/editor-web/assets/{stateDiagram-v2-A6IESKWZ-Bnp0XfpT.js → stateDiagram-v2-A6IESKWZ-kstrRKv2.js} +1 -1
  519. package/editor-web/assets/{strikethrough-DJckA35o.js → strikethrough-CfXx6IYH.js} +1 -1
  520. package/editor-web/assets/{svg-BjM9RazX.js → svg-Cx50MpxK.js} +1 -1
  521. package/editor-web/assets/swatch-WeJD41aW.js +1 -0
  522. package/editor-web/assets/{swimlanes-B3ENRKFQ-BiRRhhbd.js → swimlanes-B3ENRKFQ-DaZsZkeP.js} +1 -1
  523. package/editor-web/assets/swimlanesDiagram-AYQRV4AK-CBZAujYY.js +8 -0
  524. package/editor-web/assets/switch-N0G_sbqt.js +1 -0
  525. package/editor-web/assets/syntax-BVsgRJ4I.js +66 -0
  526. package/editor-web/assets/syntax-oWsKBWFw.js +1 -0
  527. package/editor-web/assets/table-B6hVZAMi.js +1 -0
  528. package/editor-web/assets/tabs-DIFDqj-l.js +1 -0
  529. package/editor-web/assets/{textarea-BGtPqZdB.js → textarea-tEWvBY9p.js} +1 -1
  530. package/editor-web/assets/{timeline-definition-JXYKGLGB-D-Q5ZtDF.js → timeline-definition-JXYKGLGB-CLCvY-Yf.js} +1 -1
  531. package/editor-web/assets/{trash-2-Bjj6cWzP.js → trash-2-BP6nqpg2.js} +1 -1
  532. package/editor-web/assets/{treeView-D4JQ5SDB-B6DDatXq.js → treeView-D4JQ5SDB-BmN0gwdC.js} +1 -1
  533. package/editor-web/assets/{treemap-SAJKECNS-D7j5ZhiI.js → treemap-SAJKECNS-DN29G_E_.js} +1 -1
  534. package/editor-web/assets/{undo-2-yOSG766T.js → undo-2-CHR0nvWL.js} +1 -1
  535. package/editor-web/assets/{usecaseDiagram-WPOLBNNX-tkrdKUJB.js → usecaseDiagram-WPOLBNNX-DTRS54cB.js} +1 -1
  536. package/editor-web/assets/{vennDiagram-Q3Y3IDCW-Ch4XbSnD.js → vennDiagram-Q3Y3IDCW-DAAc11Hx.js} +1 -1
  537. package/editor-web/assets/video-BlvmR8BK.js +1 -0
  538. package/editor-web/assets/{wardley-7MLQ67FV-Bynt7qNQ.js → wardley-7MLQ67FV-B-UYkmdB.js} +1 -1
  539. package/editor-web/assets/{wardleyDiagram-IVAIDKWA-DRuSgm_L.js → wardleyDiagram-IVAIDKWA-BmbwCaky.js} +1 -1
  540. package/editor-web/assets/words-D_4T9Adq.js +3 -0
  541. package/editor-web/assets/words-WgdEQdYP.js +2 -0
  542. package/editor-web/assets/{xychartDiagram-4URNHDU4-DctpvfkL.js → xychartDiagram-4URNHDU4-ChAfAq1U.js} +1 -1
  543. package/editor-web/index.html +6 -5
  544. package/package.json +8 -2
  545. package/editor-web/assets/alt-BOVao_9S.js +0 -4
  546. package/editor-web/assets/article-B6YCzhj8.js +0 -73
  547. package/editor-web/assets/calc-worker-B5-fDWnb.js +0 -45
  548. package/editor-web/assets/channel-C26aBI4o.js +0 -1
  549. package/editor-web/assets/chart-BOnxneyw.js +0 -1
  550. package/editor-web/assets/choice-O5nwc2N0.js +0 -1
  551. package/editor-web/assets/collaborator-BJU5qwHd.js +0 -1
  552. package/editor-web/assets/createLucideIcon-B3B95oX5.js +0 -1
  553. package/editor-web/assets/dist-C6NqUEG4.js +0 -16
  554. package/editor-web/assets/dist-C9UGmCG9.js +0 -6
  555. package/editor-web/assets/dist-CAk5bjBm.js +0 -1
  556. package/editor-web/assets/dist-CKyfo5RM.js +0 -340
  557. package/editor-web/assets/dist-CRaWqNwq.js +0 -37
  558. package/editor-web/assets/dist-CwIBc7HQ.js +0 -1
  559. package/editor-web/assets/dist-DXRmkezB.js +0 -38
  560. package/editor-web/assets/dist-EKK5i0dG.js +0 -219
  561. package/editor-web/assets/dist-hHJlpLWo.js +0 -5
  562. package/editor-web/assets/dist-oYKcwWUj.js +0 -4
  563. package/editor-web/assets/dist-shKo7XVN.js +0 -2
  564. package/editor-web/assets/dist-wrKxBrVu.js +0 -24
  565. package/editor-web/assets/flowDiagram-IUGLLWBU-ouDQYiTr.js +0 -1
  566. package/editor-web/assets/hint-_AQWCDMj.js +0 -1
  567. package/editor-web/assets/index-BsstP-cI.js +0 -28
  568. package/editor-web/assets/index-DQRcmxBO.css +0 -2
  569. package/editor-web/assets/minus-Cgmm6ncD.js +0 -1
  570. package/editor-web/assets/progress-0B_TVsPi.js +0 -6
  571. package/editor-web/assets/react-BP46yLMB.js +0 -1
  572. package/editor-web/assets/react-pgBZqVxJ.js +0 -96
  573. package/editor-web/assets/schemas-Ewwjtbf4.js +0 -1
  574. package/editor-web/assets/session-DiI9KYRI.js +0 -1
  575. package/editor-web/assets/slides-CCwgBcGH.js +0 -1
  576. package/editor-web/assets/sound-CqryteNl.js +0 -1
  577. package/editor-web/assets/swatch-DL3HqIjW.js +0 -1
  578. package/editor-web/assets/swimlanesDiagram-AYQRV4AK-BkOls8Tv.js +0 -8
  579. package/editor-web/assets/switch-DltnKqN-.js +0 -1
  580. package/editor-web/assets/syntax-CC6QYhCz.js +0 -1
  581. package/editor-web/assets/tabs-C-re0Kxn.js +0 -1
  582. package/editor-web/assets/video-DXFiCNGc.js +0 -1
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{format as Ct,isValidFormat as Lt}from"numfmt";import{brightened as jt}from"@allyhub/ooxml/brightness";export const themeColor=(t,s=0)=>s===0?t:{theme_color:t,brightness:s},themeColorOf=t=>typeof t=="string"?t:"theme_color"in t?t.theme_color:void 0;export function colorRgb(t,s){return typeof t=="string"?s[t]:"rgb"in t?t.rgb:jt(s[t.theme_color],t.brightness)}export const CHART_DEFAULTS={fontSize:12,titleScale:1.2,gapWidth:150,holeSize:50,margin:6,gridline:"#D9D9D9",axisLine:"#BFBFBF",letter:.55,lineWidth:2.25,gridWidth:.75,marker:5};const vt=["accent1","accent2","accent3","accent4","accent5","accent6"];export const accentOf=t=>vt[t%vt.length]??"accent1",isBar=t=>t.startsWith("column")||t.startsWith("bar"),isHorizontal=t=>t.startsWith("bar"),isLine=t=>t.startsWith("line"),isArea=t=>t.startsWith("area"),isRound=t=>t==="pie"||t==="doughnut",isScatter=t=>t.startsWith("scatter"),hasLines=t=>!isScatter(t)||t!=="scatter",hasMarkers=t=>t==="line-markers"||t==="scatter"||t==="scatter-lines",groupingOf=t=>t.endsWith("-100")?"percentStacked":t.endsWith("-stacked")?"stacked":isBar(t)?"clustered":"standard";export function labelPositionsOf(t){return isArea(t)||t==="doughnut"?[]:t==="pie"?["bestFit","outEnd","inEnd","ctr"]:isLine(t)||isScatter(t)?["t","b","l","r","ctr"]:groupingOf(t)==="clustered"?["outEnd","inEnd","ctr","inBase"]:["inEnd","ctr","inBase"]}export function labelPositionOf(t){const s=labelPositionsOf(t.type),l=t.labels?.position;if(l!==void 0&&s.includes(l))return l;if(s.length!==0)return t.type==="pie"?"ctr":isLine(t.type)||isScatter(t.type)?"t":groupingOf(t.type)==="clustered"?"outEnd":"ctr"}export const variesOf=t=>t.vary_by_categories??isRound(t.type);export function formatValue(t,s="General"){return s==="General"||!Lt(s)?String(Number(t.toPrecision(10))):Ct(s,t)}const Ft=[1,2,5,10];export function chartScale(t,s,l,r,e={}){const h=t>0&&(s-t)/s<.16666666666666666?t:Math.min(t,0),a=s<=0&&t<0?0:s,o=e.minimum_scale??h,j=e.maximum_scale??a,b=j>o?j-o:1,F=Math.max(1,Math.floor(l/r)),w=b/F,P=10**Math.floor(Math.log10(w)),O=e.major_unit??(Ft.find(E=>E*P>=w)??10)*P,B=(E,C)=>Number((C(Number((E/O).toFixed(9)))*O).toPrecision(12)),Z=a>0?a+b*.05:a===h?b:a,g=e.maximum_scale??B(Z,Math.ceil),R=h<0?h-b*.05:h,W=e.minimum_scale??B(R,Math.floor),N=[],x=Math.round((g-W)/O);for(let E=0;E<=x;E++)N.push(Number((W+E*O).toPrecision(12)));return{min:W,max:g,major:O,ticks:N}}const it=(t,s)=>{let l=0;for(const r of t)l+=(r.codePointAt(0)??0)>11903?1:CHART_DEFAULTS.letter;return l*s},m=t=>String(Number(t.toFixed(3)));function kt(t){const s=l=>t[Math.max(0,Math.min(t.length-1,l))]??[0,0];return t.map(([l,r],e)=>{if(e===0)return`M${m(l)} ${m(r)}`;const[h,a]=s(e-2),[o,j]=s(e-1),[b,F]=s(e+1),w=`${m(o+(l-h)/6)} ${m(j+(r-a)/6)}`,P=`${m(l-(b-o)/6)} ${m(r-(F-j)/6)}`;return`C${w} ${P} ${m(l)} ${m(r)}`}).join(" ")}const lt=t=>t.map(([s,l],r)=>`${r===0?"M":"L"}${m(s)} ${m(l)}`).join(" ");function Ot(t,s,l,r,e,h){const a=(F,w)=>`${m(t+F*Math.sin(w))} ${m(s-F*Math.cos(w))}`,o=h-e>=Math.PI*2?e+Math.PI*2-1e-4:h,j=o-e>Math.PI?1:0,b=`M${a(l,e)} A${m(l)} ${m(l)} 0 ${String(j)} 1 ${a(l,o)}`;return r<=0?`${b} L${m(t)} ${m(s)} Z`:`${b} L${a(r,o)} A${m(r)} ${m(r)} 0 ${String(j)} 0 ${a(r,e)} Z`}function Wt(t,s,l,r){const e=r*1.5;return s!==void 0&&s!==""&&(t.bottom-=e),l!==void 0&&l!==""&&(t.left+=e),{x:t.left-e/2,y:t.bottom+e/2}}function Et(t,s,l,r,e,h,a){r!==void 0&&r!==""&&t.words.push({x:s.x+s.width/2,y:l.y,text:r,size:h,anchor:"middle",color:a}),e!==void 0&&e!==""&&t.words.push({x:l.x,y:s.y+s.height/2,text:e,size:h,anchor:"middle",color:a,rotate:-90})}const ht=(t,s,l,r,e)=>{const h=t.labels;if(!h)return"";const a=isRound(t.type),o=[];return h.show_series_name&&o.push(r.name),h.show_category_name&&o.push(e),(h.show_value??!(h.show_percentage??!1))&&o.push(formatValue(s,h.number_format??r.number_format)),h.show_percentage&&a&&o.push(formatValue(l,h.number_format??"0%")),o.join(", ")};function Bt(t,s,l,r,e){const h=CHART_DEFAULTS,a=t.category_axis??{},o=t.value_axis??{},j=Wt(l,a.title,o.title,r),b=t.series.map(c=>c.values.flatMap(($,H)=>{const I=c.x?.[H]??(c.x?null:H+1);return I===null||$===null?[]:[[I,$]]})),F=b.flat().map(c=>c[0]),w=b.flat().map(c=>c[1]),P=c=>c.length>0?Math.min(...c):0,O=c=>c.length>0?Math.max(...c):1,B=o.number_format??t.series[0]?.number_format??"General",Z=a.number_format??"General",g=r*.5,R=chartScale(P(w),O(w),l.bottom-l.top,r*2.4,o),W=o.visible===!1?0:Math.max(0,...R.ticks.map(c=>it(formatValue(c,B),r)))+g,N=a.visible===!1?0:r*1.2+g,x={x:l.left+W,y:l.top,width:l.right-l.left-W,height:l.bottom-l.top-N};s.plot=x,Et(s,x,j,a.title,o.title,r,e);const E=chartScale(P(F),O(F),x.width,r*5,a),C=chartScale(P(w),O(w),x.height,r*2.4,o),z=c=>x.x+(Math.min(E.max,Math.max(E.min,c))-E.min)/(E.max-E.min)*x.width,D=c=>x.y+x.height-(Math.min(C.max,Math.max(C.min,c))-C.min)/(C.max-C.min)*x.height;for(const c of C.ticks){const $=D(c);(o.has_major_gridlines??!0)&&s.grid.push({d:`M${m(x.x)} ${m($)} H${m(x.x+x.width)}`,color:o.gridline_color??{rgb:h.gridline},width:h.gridWidth}),o.visible!==!1&&s.words.push({x:x.x-g,y:$,text:formatValue(c,B),size:r,anchor:"end",color:e})}for(const c of E.ticks){const $=z(c);a.has_major_gridlines===!0&&s.grid.push({d:`M${m($)} ${m(x.y)} V${m(x.y+x.height)}`,color:a.gridline_color??{rgb:h.gridline},width:h.gridWidth}),a.visible!==!1&&s.words.push({x:$,y:x.y+x.height+g+r*.6,text:formatValue(c,Z),size:r,anchor:"middle",color:e})}s.axes.push({d:`M${m(x.x)} ${m(D(Math.max(C.min,Math.min(C.max,0))))} H${m(x.x+x.width)}`,color:a.line_color??{rgb:h.axisLine},width:h.gridWidth}),t.series.forEach((c,$)=>{const H=c.color??accentOf($),I=(b[$]??[]).map(([U,Y])=>[z(U),D(Y)]);if(I.length!==0&&(hasLines(t.type)&&s.lines.push({d:t.type==="scatter-smooth"||c.smooth===!0?kt(I):lt(I),color:H,width:c.line_width??h.lineWidth,series:$}),hasMarkers(t.type)))for(const[U,Y]of I)s.dots.push({x:U,y:Y,r:(c.marker_size??h.marker)/2,color:H})})}export function chartDrawing(t,s,l){const r=CHART_DEFAULTS,e=t.font_size??r.fontSize,h=t.font_color??"dk1",a={grid:[],shapes:[],boxes:[],lines:[],axes:[],dots:[],keys:[],words:[],plot:{x:0,y:0,width:0,height:0}},o={left:r.margin,top:r.margin,right:s-r.margin,bottom:l-r.margin};if(t.title!==void 0&&t.title!==""){const n=t.title_size??e*r.titleScale;a.words.push({x:s/2,y:o.top+n*.7,text:t.title,size:n,anchor:"middle",color:h}),o.top+=n*1.6}const j=isRound(t.type),b=variesOf(t),F=(n,d)=>b?t.category_colors?.[d]??accentOf(d):t.series[n]?.color??accentOf(n);if(t.legend!==void 0){const n=b?t.categories:t.series.map(p=>p.name),d=e*.6,f=e*.4,i=e*1.5,y=n.map(p=>d+f+it(p,e)),S=(p,M,_)=>{a.keys.push({x:M,y:_-d/2,width:d,height:d,color:b?t.category_colors?.[p]??accentOf(p):t.series[p]?.color??accentOf(p),series:b?0:p,category:b?p:0}),a.words.push({x:M+d+f,y:_,text:n[p]??"",size:e,anchor:"start",color:h})};if(t.legend==="top"||t.legend==="bottom"){const p=y.reduce((A,v)=>A+v,0)+e*(n.length-1),M=t.legend==="top"?o.top+i/2:o.bottom-i/2;let _=(s-p)/2;n.forEach((A,v)=>{S(v,_,M),_+=(y[v]??0)+e}),t.legend_overlay!==!0&&(t.legend==="top"?o.top+=i:o.bottom-=i)}else{const p=Math.max(0,...y),M=t.legend==="left"?o.left:o.right-p,_=(o.top+o.bottom-i*n.length)/2+i/2;n.forEach((A,v)=>{S(v,M,_+v*i)}),t.legend_overlay!==!0&&(t.legend==="left"?o.left+=p+e:o.right-=p+e)}}const w=t.labels,P=w?.size??e,O=w?.color??h,B=(n,d,f,i,y=O)=>{f!==""&&a.words.push({x:n,y:d,text:f,size:P,anchor:i,color:y})};if(j){const n=t.series[0],d=(n?.values??[]).map(_=>Math.max(0,_??0)),f=d.reduce((_,A)=>_+A,0),i=Math.max(0,Math.min(o.right-o.left,o.bottom-o.top)/2),y=(o.left+o.right)/2,S=(o.top+o.bottom)/2,p=t.type==="doughnut"?i*((t.hole_size??r.holeSize)/100):0;a.plot={x:y-i,y:S-i,width:i*2,height:i*2};let M=0;return d.forEach((_,A)=>{const v=f>0?_/f:0,V=M+v*Math.PI*2;if(v>0){a.shapes.push({d:Ot(y,S,i,p,M,V),color:"lt1",width:1,fill:F(0,A),series:0,category:A});const L=(M+V)/2,k=p>0?(i+p)/2:labelPositionOf(t)==="inEnd"?i*.85:i*.6;n&&B(y+k*Math.sin(L),S-k*Math.cos(L),ht(t,_,v,n,t.categories[A]??""),"middle",w?.color??"lt1")}M=V}),a}if(isScatter(t.type))return Bt(t,a,o,e,h),a;const Z=Math.max(1,t.categories.length),g=isHorizontal(t.type),R=groupingOf(t.type),W=R!=="clustered"&&R!=="standard",N=R==="percentStacked",x=t.series.map(n=>t.categories.map((d,f)=>n.values[f]??null)),E=t.categories.map((n,d)=>x.reduce((f,i)=>f+Math.abs(i[d]??0),0)),C=(n,d)=>{const f=x[n]?.[d];if(f==null)return null;const i=E[d]??0;return N?i>0?f/i:0:f};let z=0,D=0;if(t.categories.forEach((n,d)=>{let f=0,i=0;t.series.forEach((y,S)=>{const p=C(S,d)??0;W?p>=0?f+=p:i+=p:(f=Math.max(f,p),i=Math.min(i,p))}),D=Math.max(D,f),z=Math.min(z,i)}),!W){const n=x.flat().filter(d=>d!==null);n.length>0&&Math.min(...n)>0&&(z=Math.min(...n))}N&&(D=1,z=Math.min(z,0));const c=t.value_axis??{},$=t.category_axis??{},H=c.number_format??(N?"0%":t.series[0]?.number_format??"General"),I=g?o.right-o.left:o.bottom-o.top,U=g?e*5:e*2.4,Y=chartScale(z,D,I,U,{...c,...N?{maximum_scale:c.maximum_scale??1}:{}}),dt=c.visible===!1?[]:Y.ticks.map(n=>formatValue(n,H)),mt=Math.max(0,...dt.map(n=>it(n,e))),ot=$.visible!==!1,ft=ot?Math.max(0,...t.categories.map(n=>it(n,e))):0,T=e*.5,ut=g?c.title:$.title,pt=g?$.title:c.title,St=Wt(o,ut,pt,e),u=g?{x:o.left+(ot?ft+T:0),y:o.top,width:0,height:o.bottom-o.top-(c.visible===!1?0:e*1.2+T)}:{x:o.left+(c.visible===!1?0:mt+T),y:o.top,width:0,height:o.bottom-o.top-(ot?e*1.2+T:0)};u.width=o.right-u.x-(g&&dt.length>0?mt/2:0),a.plot=u,Et(a,u,St,ut,pt,e,h);const G=chartScale(z,D,g?u.width:u.height,U,{...c,...N?{maximum_scale:c.maximum_scale??1}:{}}),gt=n=>(Math.min(G.max,Math.max(G.min,n))-G.min)/(G.max-G.min)*(g?u.width:u.height),q=n=>g?u.x+gt(n):u.y+u.height-gt(n),xt=isArea(t.type),yt=$.reverse_order===!0,Mt=g?!yt:yt,at=(g?u.height:u.width)/Z,_t=xt?(g?u.height:u.width)/Math.max(1,Z-1):at,ct=n=>{const d=xt?n*_t:(n+.5)*at,f=g?u.height:u.width,i=Mt?f-d:d;return(g?u.y:u.x)+i},bt=q(Math.max(G.min,Math.min(G.max,0)));for(const n of G.ticks){const d=q(n);(c.has_major_gridlines??!0)&&a.grid.push({d:g?`M${m(d)} ${m(u.y)} V${m(u.y+u.height)}`:`M${m(u.x)} ${m(d)} H${m(u.x+u.width)}`,color:c.gridline_color??{rgb:r.gridline},width:r.gridWidth}),c.visible!==!1&&a.words.push(g?{x:d,y:u.y+u.height+T+e*.6,text:formatValue(n,H),size:e,anchor:"middle",color:h}:{x:u.x-T,y:d,text:formatValue(n,H),size:e,anchor:"end",color:h})}if(a.axes.push({d:g?`M${m(bt)} ${m(u.y)} V${m(u.y+u.height)}`:`M${m(u.x)} ${m(bt)} H${m(u.x+u.width)}`,color:$.line_color??{rgb:r.axisLine},width:r.gridWidth}),ot){const n=g?e*1.3:ft+e,d=Math.max(1,Math.ceil(n/Math.max(1,_t)));t.categories.forEach((f,i)=>{if(i%d!==0)return;const y=ct(i);a.words.push(g?{x:u.x-T,y,text:f,size:e,anchor:"end",color:h}:{x:y,y:u.y+u.height+T+e*.6,text:f,size:e,anchor:"middle",color:h})})}if(isBar(t.type)){const n=(t.gap_width??r.gapWidth)/100,d=W?1:t.series.length,f=W?1:(t.overlap??0)/100,i=at/(Math.max(1,d-(d-1)*f)+n),y=i*(1-f),S=i+y*(d-1);t.categories.forEach((p,M)=>{const _=ct(M);let A=0,v=0;t.series.forEach((V,L)=>{const k=C(L,M);if(k===null)return;const nt=W?k>=0?A:v:0,tt=nt+k;W&&(k>=0?A=tt:v=tt);const J=q(nt),K=q(tt),st=(W?_-i/2:_-S/2+L*y)+(g&&Mt&&!W?S-i-2*L*y:0),Pt=g?{x:Math.min(J,K),y:st,width:Math.abs(K-J),height:i}:{x:st,y:Math.min(J,K),width:i,height:Math.abs(K-J)};if(a.boxes.push({...Pt,color:F(L,M),series:L,category:M}),!w)return;const wt=ht(t,x[L]?.[M]??0,0,V,t.categories[M]??""),rt=labelPositionOf(t),Q=P*.8,At=k>=0?1:-1,$t=(et,X)=>rt==="ctr"?(et+X)/2:rt==="inBase"?et+(X>et?Q:-Q):rt==="inEnd"?X-(X>et?Q:-Q):X+(X>=et?Q:-Q);g?B($t(J,K),st+i/2,wt,rt==="outEnd"?At>0?"start":"end":"middle"):B(st+i/2,$t(J,K),wt,"middle")})})}else{const n=t.categories.map(()=>0),d=t.series.map((f,i)=>{const y=[],S=[];return t.categories.forEach((p,M)=>{const _=C(i,M);if(_===null)return;const A=W?n[M]??0:0,v=A+_;W&&(n[M]=v);const V=ct(M),L=k=>g?[q(k),V]:[V,q(k)];if(y.push(L(v)),S.push(L(A)),isLine(t.type)&&w){const k=labelPositionOf(t),[nt,tt]=L(v);B(nt+(k==="r"?P:k==="l"?-P:0),tt+(k==="t"?-P:k==="b"?P:0),ht(t,x[i]?.[M]??0,0,f,t.categories[M]??""),k==="r"?"start":k==="l"?"end":"middle")}}),{series:f,s:i,points:y,base:S}});for(const{series:f,s:i,points:y,base:S}of d){const p=f.color??accentOf(i);if(isArea(t.type)&&y.length>0)a.shapes.push({d:`${lt([...y,...[...S].reverse()])} Z`,color:p,width:0,fill:p,series:i});else if(y.length>0&&(a.lines.push({d:f.smooth===!0?kt(y):lt(y),color:p,width:f.line_width??r.lineWidth,series:i}),hasMarkers(t.type)))for(const[M,_]of y)a.dots.push({x:M,y:_,r:(f.marker_size??r.marker)/2,color:p})}a.shapes.reverse()}return a}
2
+ import{format as Vt,isValidFormat as Rt}from"numfmt";import{brightened as Zt}from"@allyhub/ooxml/brightness";export const themeColor=(t,s=0)=>s===0?t:{theme_color:t,brightness:s},themeColorOf=t=>typeof t=="string"?t:"theme_color"in t?t.theme_color:void 0;export function colorRgb(t,s){return typeof t=="string"?s[t]:"rgb"in t?t.rgb:Zt(s[t.theme_color],t.brightness)}export const CHART_DEFAULTS={fontSize:12,titleScale:1.2,gapWidth:150,holeSize:50,margin:6,gridline:"#D9D9D9",axisLine:"#BFBFBF",letter:.55,lineWidth:2.25,gridWidth:.75,marker:5};const Ft=["accent1","accent2","accent3","accent4","accent5","accent6"];export const accentOf=t=>Ft[t%Ft.length]??"accent1",isBar=t=>t.startsWith("column")||t.startsWith("bar"),isHorizontal=t=>t.startsWith("bar"),isLine=t=>t.startsWith("line"),isArea=t=>t.startsWith("area"),isRound=t=>t==="pie"||t==="doughnut",isScatter=t=>t.startsWith("scatter"),hasLines=t=>!isScatter(t)||t!=="scatter",hasMarkers=t=>t==="line-markers"||t==="scatter"||t==="scatter-lines",groupingOf=t=>t.endsWith("-100")?"percentStacked":t.endsWith("-stacked")?"stacked":isBar(t)?"clustered":"standard";export function labelPositionsOf(t){return isArea(t)||t==="doughnut"?[]:t==="pie"?["bestFit","outEnd","inEnd","ctr"]:isLine(t)||isScatter(t)?["t","b","l","r","ctr"]:groupingOf(t)==="clustered"?["outEnd","inEnd","ctr","inBase"]:["inEnd","ctr","inBase"]}export function labelPositionOf(t){const s=labelPositionsOf(t.type),h=t.labels?.position;if(h!==void 0&&s.includes(h))return h;if(s.length!==0)return t.type==="pie"?"ctr":isLine(t.type)||isScatter(t.type)?"t":groupingOf(t.type)==="clustered"?"outEnd":"ctr"}export const isCombinable=t=>t.startsWith("column")||isLine(t)||isArea(t);export function groupsOf(t){const s=isCombinable(t.type),h=[];t.series.forEach((o,c)=>{const n=o.type!==void 0&&s&&isCombinable(o.type)?o.type??t.type:t.type,S=s&&o.secondary===!0,_=h.find(O=>O.kind===n&&O.secondary===S);_?_.series.push(c):h.push({kind:n,secondary:S,series:[c]})});const r=o=>(o.secondary?3:0)+(isArea(o.kind)?0:isBar(o.kind)?1:2);return h.sort((o,c)=>r(o)-r(c))}export const variesOf=t=>t.vary_by_categories??isRound(t.type);export function formatValue(t,s="General"){return s==="General"||!Rt(s)?String(Number(t.toPrecision(10))):Vt(s,t)}const Ut=[1,2,5,10];export function chartScale(t,s,h,r,o={}){const c=t>0&&(s-t)/s<.16666666666666666?t:Math.min(t,0),a=s<=0&&t<0?0:s,n=o.minimum_scale??c,S=o.maximum_scale??a,_=S>n?S-n:1,O=Math.max(1,Math.floor(h/r)),k=_/O,P=10**Math.floor(Math.log10(k)),N=o.major_unit??(Ut.find(v=>v*P>=k)??10)*P,z=(v,j)=>Number((j(Number((v/N).toFixed(9)))*N).toPrecision(12)),q=a>0?a+_*.05:a===c?_:a,x=o.maximum_scale??z(q,Math.ceil),Z=c<0?c-_*.05:c,V=o.minimum_scale??z(Z,Math.floor),D=[],y=Math.round((x-V)/N);for(let v=0;v<=y;v++)D.push(Number((V+v*N).toPrecision(12)));return{min:V,max:x,major:N,ticks:D}}const it=(t,s)=>{let h=0;for(const r of t)h+=(r.codePointAt(0)??0)>11903?1:CHART_DEFAULTS.letter;return h*s},m=t=>String(Number(t.toFixed(3)));function jt(t){const s=h=>t[Math.max(0,Math.min(t.length-1,h))]??[0,0];return t.map(([h,r],o)=>{if(o===0)return`M${m(h)} ${m(r)}`;const[c,a]=s(o-2),[n,S]=s(o-1),[_,O]=s(o+1),k=`${m(n+(h-c)/6)} ${m(S+(r-a)/6)}`,P=`${m(h-(_-n)/6)} ${m(r-(O-S)/6)}`;return`C${k} ${P} ${m(h)} ${m(r)}`}).join(" ")}const gt=t=>t.map(([s,h],r)=>`${r===0?"M":"L"}${m(s)} ${m(h)}`).join(" ");function qt(t,s,h,r,o,c){const a=(O,k)=>`${m(t+O*Math.sin(k))} ${m(s-O*Math.cos(k))}`,n=c-o>=Math.PI*2?o+Math.PI*2-1e-4:c,S=n-o>Math.PI?1:0,_=`M${a(h,o)} A${m(h)} ${m(h)} 0 ${String(S)} 1 ${a(h,n)}`;return r<=0?`${_} L${m(t)} ${m(s)} Z`:`${_} L${a(r,n)} A${m(r)} ${m(r)} 0 ${String(S)} 0 ${a(r,o)} Z`}function Nt(t,s,h,r){const o=r*1.5;return s!==void 0&&s!==""&&(t.bottom-=o),h!==void 0&&h!==""&&(t.left+=o),{x:t.left-o/2,y:t.bottom+o/2}}function Bt(t,s,h,r,o,c,a){r!==void 0&&r!==""&&t.words.push({x:s.x+s.width/2,y:h.y,text:r,size:c,anchor:"middle",color:a}),o!==void 0&&o!==""&&t.words.push({x:h.x,y:s.y+s.height/2,text:o,size:c,anchor:"middle",color:a,rotate:-90})}const xt=(t,s,h,r,o)=>{const c=t.labels;if(!c)return"";const a=isRound(t.type),n=[];return c.show_series_name&&n.push(r.name),c.show_category_name&&n.push(o),(c.show_value??!(c.show_percentage??!1))&&n.push(formatValue(s,c.number_format??r.number_format)),c.show_percentage&&a&&n.push(formatValue(h,c.number_format??"0%")),n.join(", ")};function Jt(t,s,h,r,o){const c=CHART_DEFAULTS,a=t.category_axis??{},n=t.value_axis??{},S=Nt(h,a.title,n.title,r),_=t.series.map(f=>f.values.flatMap((W,B)=>{const I=f.x?.[B]??(f.x?null:B+1);return I===null||W===null?[]:[[I,W]]})),O=_.flat().map(f=>f[0]),k=_.flat().map(f=>f[1]),P=f=>f.length>0?Math.min(...f):0,N=f=>f.length>0?Math.max(...f):1,z=n.number_format??t.series[0]?.number_format??"General",q=a.number_format??"General",x=r*.5,Z=chartScale(P(k),N(k),h.bottom-h.top,r*2.4,n),V=n.visible===!1?0:Math.max(0,...Z.ticks.map(f=>it(formatValue(f,z),r)))+x,D=a.visible===!1?0:r*1.2+x,y={x:h.left+V,y:h.top,width:h.right-h.left-V,height:h.bottom-h.top-D};s.plot=y,Bt(s,y,S,a.title,n.title,r,o);const v=chartScale(P(O),N(O),y.width,r*5,a),j=chartScale(P(k),N(k),y.height,r*2.4,n),U=f=>y.x+(Math.min(v.max,Math.max(v.min,f))-v.min)/(v.max-v.min)*y.width,G=f=>y.y+y.height-(Math.min(j.max,Math.max(j.min,f))-j.min)/(j.max-j.min)*y.height;for(const f of j.ticks){const W=G(f);(n.has_major_gridlines??!0)&&s.grid.push({d:`M${m(y.x)} ${m(W)} H${m(y.x+y.width)}`,color:n.gridline_color??{rgb:c.gridline},width:c.gridWidth}),n.visible!==!1&&s.words.push({x:y.x-x,y:W,text:formatValue(f,z),size:r,anchor:"end",color:o})}for(const f of v.ticks){const W=U(f);a.has_major_gridlines===!0&&s.grid.push({d:`M${m(W)} ${m(y.y)} V${m(y.y+y.height)}`,color:a.gridline_color??{rgb:c.gridline},width:c.gridWidth}),a.visible!==!1&&s.words.push({x:W,y:y.y+y.height+x+r*.6,text:formatValue(f,q),size:r,anchor:"middle",color:o})}s.axes.push({d:`M${m(y.x)} ${m(G(Math.max(j.min,Math.min(j.max,0))))} H${m(y.x+y.width)}`,color:a.line_color??{rgb:c.axisLine},width:c.gridWidth}),t.series.forEach((f,W)=>{const B=f.color??accentOf(W),I=(_[W]??[]).map(([J,R])=>[U(J),G(R)]);if(I.length!==0&&(hasLines(t.type)&&s.lines.push({d:t.type==="scatter-smooth"||f.smooth===!0?jt(I):gt(I),color:B,width:f.line_width??c.lineWidth,series:W}),hasMarkers(t.type)))for(const[J,R]of I)s.dots.push({x:J,y:R,r:(f.marker_size??c.marker)/2,color:B})})}export function chartDrawing(t,s,h){const r=CHART_DEFAULTS,o=t.font_size??r.fontSize,c=t.font_color??"dk1",a={grid:[],shapes:[],boxes:[],lines:[],axes:[],dots:[],keys:[],words:[],plot:{x:0,y:0,width:0,height:0}},n={left:r.margin,top:r.margin,right:s-r.margin,bottom:h-r.margin};if(t.title!==void 0&&t.title!==""){const e=t.title_size??o*r.titleScale;a.words.push({x:s/2,y:n.top+e*.7,text:t.title,size:e,anchor:"middle",color:c}),n.top+=e*1.6}const S=isRound(t.type),_=variesOf(t),O=(e,i)=>_?t.category_colors?.[i]??accentOf(i):t.series[e]?.color??accentOf(e);if(t.legend!==void 0){const e=_?t.categories:t.series.map(d=>d.name),i=o*.6,g=o*.4,l=o*1.5,b=e.map(d=>i+g+it(d,o)),F=(d,w,u)=>{a.keys.push({x:w,y:u-i/2,width:i,height:i,color:_?t.category_colors?.[d]??accentOf(d):t.series[d]?.color??accentOf(d),series:_?0:d,category:_?d:0}),a.words.push({x:w+i+g,y:u,text:e[d]??"",size:o,anchor:"start",color:c})};if(t.legend==="top"||t.legend==="bottom"){const d=b.reduce((E,M)=>E+M,0)+o*(e.length-1),w=t.legend==="top"?n.top+l/2:n.bottom-l/2;let u=(s-d)/2;e.forEach((E,M)=>{F(M,u,w),u+=(b[M]??0)+o}),t.legend_overlay!==!0&&(t.legend==="top"?n.top+=l:n.bottom-=l)}else{const d=Math.max(0,...b),w=t.legend==="left"?n.left:n.right-d,u=(n.top+n.bottom-l*e.length)/2+l/2;e.forEach((E,M)=>{F(M,w,u+M*l)}),t.legend_overlay!==!0&&(t.legend==="left"?n.left+=d+o:n.right-=d+o)}}const k=t.labels,P=k?.size??o,N=k?.color??c,z=(e,i,g,l,b=N)=>{g!==""&&a.words.push({x:e,y:i,text:g,size:P,anchor:l,color:b})};if(S){const e=t.series[0],i=(e?.values??[]).map(u=>Math.max(0,u??0)),g=i.reduce((u,E)=>u+E,0),l=Math.max(0,Math.min(n.right-n.left,n.bottom-n.top)/2),b=(n.left+n.right)/2,F=(n.top+n.bottom)/2,d=t.type==="doughnut"?l*((t.hole_size??r.holeSize)/100):0;a.plot={x:b-l,y:F-l,width:l*2,height:l*2};let w=0;return i.forEach((u,E)=>{const M=g>0?u/g:0,$=w+M*Math.PI*2;if(M>0){a.shapes.push({d:qt(b,F,l,d,w,$),color:"lt1",width:1,fill:O(0,E),series:0,category:E});const A=(w+$)/2,T=d>0?(l+d)/2:labelPositionOf(t)==="inEnd"?l*.85:l*.6;e&&z(b+T*Math.sin(A),F-T*Math.cos(A),xt(t,u,M,e,t.categories[E]??""),"middle",k?.color??"lt1")}w=$}),a}if(isScatter(t.type))return Jt(t,a,n,o,c),a;const q=Math.max(1,t.categories.length),x=isHorizontal(t.type),Z=groupsOf(t),V=Z.every(e=>e.secondary)?Z.map(e=>({...e,secondary:!1})):Z,D=t.series.map(e=>t.categories.map((i,g)=>e.values[g]??null)),y=V.map(e=>{const i=groupingOf(e.kind),g=i!=="clustered"&&i!=="standard",l=i==="percentStacked",b=t.categories.map((F,d)=>e.series.reduce((w,u)=>w+Math.abs(D[u]?.[d]??0),0));return{...e,stacked:g,percent:l,totals:b}}),v=(e,i,g)=>{const l=D[i]?.[g];if(l==null)return null;const b=e.totals[g]??0;return e.percent?b>0?l/b:0:l},j=e=>{let i=0,g=0,l=1/0,b=!1;for(const u of y)if(u.secondary===e&&(b||=u.percent,t.categories.forEach((E,M)=>{let $=0,A=0;for(const T of u.series){const C=v(u,T,M)??0;u.stacked?C>=0?$+=C:A+=C:($=Math.max($,C),A=Math.min(A,C))}g=Math.max(g,$),i=Math.min(i,A)}),!u.stacked))for(const E of u.series)for(const M of D[E]??[])M!==null&&(l=Math.min(l,M));y.every(u=>u.secondary!==e||!u.stacked)&&Number.isFinite(l)&&l>0&&(i=l),b&&(g=1,i=Math.min(i,0));const d=y.find(u=>u.secondary===e),w=d===void 0?void 0:d.series[0];return{low:i,high:g,percent:b,format:w===void 0?void 0:t.series[w]?.number_format}},U=j(!1),G=y.some(e=>e.secondary)?j(!0):void 0,f=t.value_axis??{},W=t.secondary_axis??{},B=t.category_axis??{},I=f.number_format??(U.percent?"0%":U.format??"General"),J=W.number_format??(G?.percent===!0?"0%":G?.format??"General"),R=(e,i,g,l)=>chartScale(e.low,e.high,g,l,{...i,...e.percent?{maximum_scale:i.maximum_scale??1}:{}}),yt=x?n.right-n.left:n.bottom-n.top,at=x?o*5:o*2.4,It=R(U,f,yt,at),bt=f.visible===!1?[]:It.ticks.map(e=>formatValue(e,I)),Mt=Math.max(0,...bt.map(e=>it(e,o))),wt=G===void 0||W.visible===!1?0:Math.max(0,...R(G,W,yt,at).ticks.map(e=>it(formatValue(e,J),o))),ct=B.visible!==!1,_t=ct?Math.max(0,...t.categories.map(e=>it(e,o))):0,H=o*.5,$t=x?f.title:B.title,kt=x?B.title:f.title,zt=Nt(n,$t,kt,o),p=x?{x:n.left+(ct?_t+H:0),y:n.top,width:0,height:n.bottom-n.top-(f.visible===!1?0:o*1.2+H)}:{x:n.left+(f.visible===!1?0:Mt+H),y:n.top,width:0,height:n.bottom-n.top-(ct?o*1.2+H:0)};p.width=n.right-p.x-(x&&bt.length>0?Mt/2:0)-(wt>0?wt+H:0),a.plot=p,Bt(a,p,zt,$t,kt,o,c);const ft=x?p.width:p.height,et=R(U,f,ft,at),ot=G===void 0?void 0:R(G,W,ft,at),vt=(e,i)=>(Math.min(e.max,Math.max(e.min,i))-e.min)/(e.max-e.min)*ft,ut=(e,i)=>x?p.x+vt(e,i):p.y+p.height-vt(e,i),Wt=e=>ut(et,e),Et=y.every(e=>isArea(e.kind)),St=B.reverse_order===!0,Ot=x?!St:St,mt=(x?p.height:p.width)/q,Pt=Et?(x?p.height:p.width)/Math.max(1,q-1):mt,pt=e=>{const i=Et?e*Pt:(e+.5)*mt,g=x?p.height:p.width,l=Ot?g-i:i;return(x?p.y:p.x)+l},At=Wt(Math.max(et.min,Math.min(et.max,0)));for(const e of et.ticks){const i=Wt(e);(f.has_major_gridlines??!0)&&a.grid.push({d:x?`M${m(i)} ${m(p.y)} V${m(p.y+p.height)}`:`M${m(p.x)} ${m(i)} H${m(p.x+p.width)}`,color:f.gridline_color??{rgb:r.gridline},width:r.gridWidth}),f.visible!==!1&&a.words.push(x?{x:i,y:p.y+p.height+H+o*.6,text:formatValue(e,I),size:o,anchor:"middle",color:c}:{x:p.x-H,y:i,text:formatValue(e,I),size:o,anchor:"end",color:c})}if(ot&&W.visible!==!1)for(const e of ot.ticks)a.words.push({x:p.x+p.width+H,y:ut(ot,e),text:formatValue(e,J),size:o,anchor:"start",color:c});if(a.axes.push({d:x?`M${m(At)} ${m(p.y)} V${m(p.y+p.height)}`:`M${m(p.x)} ${m(At)} H${m(p.x+p.width)}`,color:B.line_color??{rgb:r.axisLine},width:r.gridWidth}),ct){const e=x?o*1.3:_t+o,i=Math.max(1,Math.ceil(e/Math.max(1,Pt)));t.categories.forEach((g,l)=>{if(l%i!==0)return;const b=pt(l);a.words.push(x?{x:p.x-H,y:b,text:g,size:o,anchor:"end",color:c}:{x:b,y:p.y+p.height+H+o*.6,text:g,size:o,anchor:"middle",color:c})})}for(const e of y){const i=e.secondary&&ot?ot:et,g=b=>ut(i,b),l={type:e.kind,...t.labels===void 0?{}:{labels:t.labels}};isBar(e.kind)?Dt(e,g,l):Gt(e,g,l)}return a;function Dt(e,i,g){const l=(t.gap_width??r.gapWidth)/100,b=e.stacked?1:e.series.length,F=e.stacked?1:(t.overlap??0)/100,d=mt/(Math.max(1,b-(b-1)*F)+l),w=d*(1-F),u=d+w*(b-1);t.categories.forEach((E,M)=>{const $=pt(M);let A=0,T=0;e.series.forEach((C,nt)=>{const K=t.series[C],L=v(e,C,M);if(L===null||!K)return;const lt=e.stacked?L>=0?A:T:0,st=lt+L;e.stacked&&(L>=0?A=st:T=st);const Q=i(lt),X=i(st),ht=(e.stacked?$-d/2:$-u/2+nt*w)+(x&&Ot&&!e.stacked?u-d-2*nt*w:0),Ht=x?{x:Math.min(Q,X),y:ht,width:Math.abs(X-Q),height:d}:{x:ht,y:Math.min(Q,X),width:d,height:Math.abs(X-Q)};if(a.boxes.push({...Ht,color:O(C,M),series:C,category:M}),!k)return;const Ct=xt(t,D[C]?.[M]??0,0,K,t.categories[M]??""),dt=labelPositionOf(g),Y=P*.8,Tt=L>=0?1:-1,Lt=(rt,tt)=>dt==="ctr"?(rt+tt)/2:dt==="inBase"?rt+(tt>rt?Y:-Y):dt==="inEnd"?tt-(tt>rt?Y:-Y):tt+(tt>=rt?Y:-Y);x?z(Lt(Q,X),ht+d/2,Ct,dt==="outEnd"?Tt>0?"start":"end":"middle"):z(ht+d/2,Lt(Q,X),Ct,"middle")})})}function Gt(e,i,g){const l=t.categories.map(()=>0),b=e.series.map(d=>{const w=t.series[d],u=[],E=[];return t.categories.forEach((M,$)=>{const A=v(e,d,$);if(A===null||!w)return;const T=e.stacked?l[$]??0:0,C=T+A;e.stacked&&(l[$]=C);const nt=pt($),K=L=>x?[i(L),nt]:[nt,i(L)];if(u.push(K(C)),E.push(K(T)),isLine(e.kind)&&k){const L=labelPositionOf(g),[lt,st]=K(C);z(lt+(L==="r"?P:L==="l"?-P:0),st+(L==="t"?-P:L==="b"?P:0),xt(t,D[d]?.[$]??0,0,w,t.categories[$]??""),L==="r"?"start":L==="l"?"end":"middle")}}),{series:w,s:d,points:u,base:E}}),F=[];for(const{series:d,s:w,points:u,base:E}of b){if(!d)continue;const M=d.color??accentOf(w);if(isArea(e.kind)&&u.length>0)F.push({d:`${gt([...u,...[...E].reverse()])} Z`,color:M,width:0,fill:M,series:w});else if(u.length>0&&(a.lines.push({d:d.smooth===!0?jt(u):gt(u),color:M,width:d.line_width??r.lineWidth,series:w}),hasMarkers(e.kind)))for(const[$,A]of u)a.dots.push({x:$,y:A,r:(d.marker_size??r.marker)/2,color:M})}a.shapes.push(...F.reverse())}}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/chart",
3
- "version": "0.9.0",
3
+ "version": "0.11.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/check",
3
- "version": "0.9.0",
3
+ "version": "0.11.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -8,12 +8,20 @@ export interface Key {
8
8
  account: string;
9
9
  /** When it stops working (ISO 8601); a key from the environment does not say. */
10
10
  expiresAt?: string;
11
+ /** The sign-in's id, sent as DEVICE_HEADER so AllyHub knows which computer asks. */
12
+ device?: string;
11
13
  }
12
14
  /** Removes anything key-shaped from text that may reach the screen. */
13
15
  export declare function scrub(text: string, key?: string): string;
14
16
  export declare class Cloud {
15
17
  readonly config: CloudConfig;
16
18
  constructor(config: CloudConfig);
19
+ /**
20
+ * Run by an agent in Studio, Studio is told a call was refused for
21
+ * credits, and offers the person to buy them. Never fails the command:
22
+ * a Host that does not answer in a second is left.
23
+ */
24
+ private tellStudio;
17
25
  get url(): string;
18
26
  /**
19
27
  * The key to use, or undefined when this computer is not signed in;
@@ -38,6 +46,8 @@ export declare class Cloud {
38
46
  body?: unknown;
39
47
  auth?: boolean;
40
48
  signal?: AbortSignal;
49
+ /** The team it acts in, when not the one this computer works in. */
50
+ organization?: string;
41
51
  }): Promise<unknown>;
42
52
  }
43
53
  //# sourceMappingURL=client.d.ts.map
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{createHash as l}from"node:crypto";import{EXIT as a,ORGANIZATION_HEADER as y}from"@allyhub/protocol";import{accessOf as g,SignedOut as w}from"./credentials.js";import{CloudError as u,notSignedIn as f,unreachable as h}from"./errors.js";export function scrub(d,i){let e=d.replace(/(authorization)\s*[:=]\s*[^\r\n]+/giu,"$1: <redacted>");return e=e.replace(/\bahk_[A-Za-z0-9_-]+/gu,"<api-key>"),e=e.replace(/\beyJ[\w-]+\.[\w-]+\.[\w-]+/gu,"<token>"),i&&(e=e.split(i).join("<key>")),e}export class Cloud{config;constructor(i){this.config=i}get url(){return this.config.url}async key(i={}){const e=this.config.apiKey;if(e)return{key:e,source:"env",account:l("sha256").update(e).digest("hex")};try{const r=await g(this.config,i);if(!r)return;const t=r.credentials.account.organization?.id;return{key:r.token,source:"oauth",account:r.credentials.account.id,expiresAt:r.expiresAt,...t===void 0?{}:{organization:t}}}catch(r){if(r instanceof w)return;throw h(this.url,r)}}async requireKey(){const i=await this.key();if(!i)throw f();return i}keyedFetch=async(i,e)=>{const r=c=>{const o=new Headers(e?.headers);return o.set("authorization",`Bearer ${c.key}`),c.organization!==void 0&&o.set(y,c.organization),this.config.fetch(i,{...e,headers:o})},t=await this.requireKey(),n=await r(t);if(n.status!==401||t.source!=="oauth"||e?.body instanceof ReadableStream||i instanceof Request)return n;const s=await this.key({refused:t.key});return s===void 0?n:(await n.body?.cancel(),r(s))};async json(i,e={}){const r=e.auth!==!1,t=r?(await this.requireKey()).key:void 0;let n;try{n=await(r?this.keyedFetch:this.config.fetch)(`${this.url}${i}`,{redirect:"error",signal:e.signal??AbortSignal.timeout(3e4),method:e.method??"GET",headers:{accept:"application/json",...e.body===void 0?{}:{"content-type":"application/json"}},...e.body===void 0?{}:{body:JSON.stringify(e.body)}})}catch(o){throw o instanceof u?o:h(this.url,o)}const s=await n.text(),c=n.ok?void 0:b(s,n.status,t);if(c&&n.status!==401)throw c;if(n.status===403)throw new u("forbidden","This AllyHub account does not have access to this operation.",{exit:a.auth,status:403});if(n.status===401)throw f(r?"This computer's AllyHub sign-in is not valid any more.":void 0);if(!n.ok)throw new u("api-error",`${this.url}${i} answered ${String(n.status)}: ${scrub(s.slice(0,300),t)}`,{exit:n.status>=500?a.platform:a.usage,status:n.status});try{return JSON.parse(s)}catch{throw new u("api-error",`${this.url}${i} did not answer JSON.`,{exit:a.platform,status:n.status})}}}const p={bad_input:a.usage,insufficient_credits:a.auth,limit_reached:a.auth,forbidden:a.auth,not_found:a.notFound,conflict:a.conflict,worked_elsewhere:a.conflict};function b(d,i,e){let r;try{r=JSON.parse(d)}catch{return}const t=r?.error;if(typeof t?.code!="string"||typeof t.message!="string")return;const n=typeof t.hint=="string"?t.hint:t.code==="insufficient_credits"?"Add credits to the AllyHub account.":void 0;return new u(t.code.replaceAll("_","-"),scrub(t.message,e),{exit:p[t.code]??a.platform,status:i,...n===void 0?{}:{hint:n},...typeof t.data=="object"&&t.data!==null?{data:t.data}:{}})}
2
+ import{createHash as g}from"node:crypto";import{BILLING_PAGE_PATH as h,DEVICE_HEADER as w,EXIT as a,ORGANIZATION_HEADER as f}from"@allyhub/protocol";import{accessOf as p,SignedOut as m}from"./credentials.js";import{CloudError as d,notSignedIn as l,unreachable as y}from"./errors.js";export function scrub(u,n){let t=u.replace(/(authorization)\s*[:=]\s*[^\r\n]+/giu,"$1: <redacted>");return t=t.replace(/\bahk_[A-Za-z0-9_-]+/gu,"<api-key>"),t=t.replace(/\beyJ[\w-]+\.[\w-]+\.[\w-]+/gu,"<token>"),n&&(t=t.split(n).join("<key>")),t}export class Cloud{config;constructor(n){this.config=n}async tellStudio(){const n=this.config.studioHost;n!==void 0&&await fetch(`${n}/out-of-credits`,{method:"POST",signal:AbortSignal.timeout(1e3)}).then(t=>t.body?.cancel(),()=>{})}get url(){return this.config.url}async key(n={}){const t=this.config.apiKey;if(t)return{key:t,source:"env",account:g("sha256").update(t).digest("hex")};try{const i=await p(this.config,n);if(!i)return;const o=i.credentials.account.organization?.id,e=i.credentials.device;return{key:i.token,source:"oauth",account:i.credentials.account.id,expiresAt:i.expiresAt,...o===void 0?{}:{organization:o},...e===void 0?{}:{device:e}}}catch(i){if(i instanceof m)return;throw y(this.url,i)}}async requireKey(){const n=await this.key();if(!n)throw l();return n}keyedFetch=async(n,t)=>{const i=s=>{const c=new Headers(t?.headers);return c.set("authorization",`Bearer ${s.key}`),s.organization!==void 0&&!c.has(f)&&c.set(f,s.organization),s.device!==void 0&&c.set(w,s.device),this.config.fetch(n,{...t,headers:c})},o=await this.requireKey(),e=await i(o);if(e.status!==401||o.source!=="oauth"||t?.body instanceof ReadableStream||n instanceof Request)return e;const r=await this.key({refused:o.key});return r===void 0?e:(await e.body?.cancel(),i(r))};async json(n,t={}){const i=t.auth!==!1,o=i?(await this.requireKey()).key:void 0;let e;try{e=await(i?this.keyedFetch:this.config.fetch)(`${this.url}${n}`,{redirect:"error",signal:t.signal??AbortSignal.timeout(3e4),method:t.method??"GET",headers:{accept:"application/json",...t.body===void 0?{}:{"content-type":"application/json"},...t.organization===void 0?{}:{[f]:t.organization}},...t.body===void 0?{}:{body:JSON.stringify(t.body)}})}catch(c){throw c instanceof d?c:y(this.url,c)}const r=await e.text(),s=e.ok?void 0:_(r,e.status,o,this.url);if(s?.code==="insufficient-credits"&&await this.tellStudio(),s&&e.status!==401)throw s;if(e.status===403)throw new d("forbidden","This AllyHub account does not have access to this operation.",{exit:a.auth,status:403});if(e.status===401)throw l(i?"This computer's AllyHub sign-in is not valid any more.":void 0);if(!e.ok)throw new d("api-error",`${this.url}${n} answered ${String(e.status)}: ${scrub(r.slice(0,300),o)}`,{exit:e.status>=500?a.platform:a.usage,status:e.status});try{return JSON.parse(r)}catch{throw new d("api-error",`${this.url}${n} did not answer JSON.`,{exit:a.platform,status:e.status})}}}const b={bad_input:a.usage,insufficient_credits:a.auth,plan_required:a.auth,tool_off:a.auth,limit_reached:a.auth,forbidden:a.auth,not_found:a.notFound,conflict:a.conflict,worked_elsewhere:a.conflict};function _(u,n,t,i){let o;try{o=JSON.parse(u)}catch{return}const e=o?.error;if(typeof e?.code!="string"||typeof e.message!="string")return;const r=e.code==="insufficient_credits"?`Buy credits at ${i}${h}?view=credits, or ask an owner or admin of the team to.`:e.code==="plan_required"?`Subscribe at ${i}${h}?view=plans, or ask an owner or admin of the team to.`:e.code==="tool_off"?`Turn it on in Capabilities at ${i}/, or ask an owner or admin of the team to.`:typeof e.hint=="string"?e.hint:void 0;return new d(e.code.replaceAll("_","-"),scrub(e.message,t),{exit:b[e.code]??a.platform,status:n,...r===void 0?{}:{hint:r},...typeof e.data=="object"&&e.data!==null?{data:e.data}:{}})}
@@ -15,9 +15,18 @@ export interface CloudConfig {
15
15
  apiKey?: string;
16
16
  /** The fetch every request goes through (a test's own). */
17
17
  fetch: typeof fetch;
18
+ /** The program, as its User-Agent's product names it ("AllyHub-Studio/0.9.1"): told to AllyHub as it signs in. */
19
+ client?: string;
20
+ /**
21
+ * Studio's Host, when an agent in Studio runs this (`ALLYHUB_STUDIO_HOST`,
22
+ * a loopback address with its token): told when a call is refused for
23
+ * credits, so Studio offers to buy them.
24
+ */
25
+ studioHost?: string;
18
26
  }
19
27
  export declare function cloudConfig(env: Readonly<Record<string, string | undefined>>, options?: {
20
28
  fetch?: typeof fetch;
29
+ client?: string;
21
30
  }): CloudConfig;
22
31
  /** "https://…", marked when a variable set it: a test box is never taken for production. */
23
32
  export declare function hostsText(c: CloudConfig): string;
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{homedir as s}from"node:os";import{join as f}from"node:path";import{API_KEY_ENV as l,CREDENTIALS_FILE as L}from"@allyhub/protocol";import{cacheHome as h}from"@allyhub/runtimes";import{osKeychain as d}from"./keychain.js";const p="https://app.allyhub.com",a=["ALLYHUB_URL"],E=o=>o.replace(/\/+$/u,"");export function cloudConfig(o,m={}){const r=o[l]?.trim(),t=E(o.ALLYHUB_URL??p),e=o.ALLYHUB_HOME,i=f(e??s(),L),n=o.ALLYHUB_CREDENTIALS_STORE,c=n==="keychain"||n!=="file"&&e===void 0?d({service:"AllyHub",account:e===void 0?t:`${t} ${i}`}):void 0;return{url:t,from:a.filter(u=>o[u]!==void 0),credentialsFile:i,...c?{keychain:c}:{},cacheDir:f(h(o),"cloud"),...r?{apiKey:r}:{},fetch:m.fetch??fetch}}export function hostsText(o){return o.from.length>0?`${o.url} (from ${o.from.join(", ")})`:o.url}
2
+ import{homedir as s}from"node:os";import{join as m}from"node:path";import{API_KEY_ENV as l,CREDENTIALS_FILE as d}from"@allyhub/protocol";import{cacheHome as _}from"@allyhub/runtimes";import{osKeychain as h}from"./keychain.js";const H="https://app.allyhub.com",U=["ALLYHUB_URL"],A=o=>o.replace(/\/+$/u,"");export function cloudConfig(o,r={}){const i=o[l]?.trim(),t=A(o.ALLYHUB_URL??H),e=o.ALLYHUB_HOME,c=r.client??o.ALLYHUB_CLIENT,n=m(e??s(),d),f=o.ALLYHUB_CREDENTIALS_STORE,L=f==="keychain"||f!=="file"&&e===void 0?h({service:"AllyHub",account:e===void 0?t:`${t} ${n}`}):void 0;return{url:t,from:U.filter(u=>o[u]!==void 0),credentialsFile:n,...L?{keychain:L}:{},cacheDir:m(_(o),"cloud"),...i?{apiKey:i}:{},fetch:r.fetch??fetch,...c===void 0?{}:{client:c},...o.ALLYHUB_STUDIO_HOST?{studioHost:o.ALLYHUB_STUDIO_HOST}:{}}}export function hostsText(o){return o.from.length>0?`${o.url} (from ${o.from.join(", ")})`:o.url}
@@ -28,7 +28,7 @@ export declare function forgetCredentials(c: Where, refreshToken?: string): Prom
28
28
  /** Who an access token is, and the organization it acts in. */
29
29
  export declare function accountOf(c: Pick<CloudConfig, "url" | "fetch">, token: string): Promise<Account>;
30
30
  /** A code from the authorization endpoint, with its PKCE verifier, made this computer's sign-in. */
31
- export declare function signInWithCode(c: Pick<CloudConfig, "url" | "fetch" | "credentialsFile" | "keychain">, exchange: {
31
+ export declare function signInWithCode(c: Pick<CloudConfig, "url" | "fetch" | "credentialsFile" | "keychain" | "client">, exchange: {
32
32
  code: string;
33
33
  codeVerifier: string;
34
34
  redirectUri: string;
@@ -38,7 +38,7 @@ export declare function signInWithCode(c: Pick<CloudConfig, "url" | "fetch" | "c
38
38
  * with no browser: `show` is given the code and the address to enter it
39
39
  * at, then this waits, polling as the server asks, until the person has.
40
40
  */
41
- export declare function signInWithDevice(c: Pick<CloudConfig, "url" | "fetch" | "credentialsFile" | "keychain">, show: (device: DeviceAuthorization) => void, signal?: AbortSignal): Promise<Credentials>;
41
+ export declare function signInWithDevice(c: Pick<CloudConfig, "url" | "fetch" | "credentialsFile" | "keychain" | "client">, show: (device: DeviceAuthorization) => void, signal?: AbortSignal): Promise<Credentials>;
42
42
  /**
43
43
  * An access token from the computer's sign-in: the one kept while it has
44
44
  * more than a minute left, else a new one made with the refresh token
@@ -50,7 +50,7 @@ export declare function signInWithDevice(c: Pick<CloudConfig, "url" | "fetch" |
50
50
  * sign-in another version kept in its file moves its tokens to the
51
51
  * system's store, where there is one.
52
52
  */
53
- export declare function accessOf(c: Pick<CloudConfig, "url" | "fetch" | "credentialsFile" | "keychain">, o?: {
53
+ export declare function accessOf(c: Pick<CloudConfig, "url" | "fetch" | "credentialsFile" | "keychain" | "client">, o?: {
54
54
  refused?: string;
55
55
  }): Promise<{
56
56
  token: string;
@@ -62,7 +62,7 @@ export declare function accessOf(c: Pick<CloudConfig, "url" | "fetch" | "credent
62
62
  * 7009), every program here with it, and the file and the store's entry forgotten. The file goes
63
63
  * even when AllyHub cannot be reached; that it was not revoked is thrown after.
64
64
  */
65
- export declare function signOut(c: Pick<CloudConfig, "url" | "fetch" | "credentialsFile" | "keychain">, credentials: Credentials): Promise<void>;
65
+ export declare function signOut(c: Pick<CloudConfig, "url" | "fetch" | "credentialsFile" | "keychain" | "client">, credentials: Credentials): Promise<void>;
66
66
  /**
67
67
  * The organization this computer's requests act in from now on (and pay
68
68
  * from): kept in the credentials file, under its lock, so a refresh at the
@@ -1,3 +1,3 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{randomBytes as S}from"node:crypto";import{chmod as $,mkdir as p,readFile as x,rename as E,rm as w,stat as D,writeFile as F}from"node:fs/promises";import{dirname as A}from"node:path";import*as k from"zod";import{ACCOUNT_PATH as H,AccountSchema as M,AuthServerSchema as C,CLIENT_ID as d,CredentialsFileSchema as T,DeviceAuthorizationSchema as P,METADATA_PATH as z,OAuthErrorSchema as j,SCOPES as I,TokenResponseSchema as N}from"@allyhub/protocol";import{notSignedIn as R}from"./errors.js";export class SignedOut extends Error{}const J=6e4,l={waitMs:15e3,staleMs:3e4,stepMs:50},m=new Map;export function authServer(e){let r=m.get(e.url);return r||(r=(async()=>{const t=await e.fetch(`${e.url}${z}`,{redirect:"error",headers:{accept:"application/json"},signal:AbortSignal.timeout(3e4)});if(!t.ok)throw new Error(`AllyHub's sign-in metadata answered ${String(t.status)}.`);return C.parse(await t.json())})(),r.catch(()=>m.delete(e.url)),m.set(e.url,r)),r}const L=k.object({revision:k.string().min(1),refreshToken:k.string().min(1),access:T.shape.access}),h=new Map;async function U(e,r,t){const n=h.get(e.credentialsFile);if(!t&&n?.revision===r)return n;if(e.keychain)try{const o=await e.keychain.get(),i=L.safeParse(o===void 0?void 0:JSON.parse(o));return!i.success||i.data.revision!==r?void 0:(h.set(e.credentialsFile,i.data),i.data)}catch{return}}export async function readCredentials(e,r=!1){for(let t=0;t<3;t+=1){let n;try{const i=T.safeParse(JSON.parse(await x(e.credentialsFile,"utf8")));if(!i.success||i.data.url!==e.url)return;n=i.data}catch{return}if(n.keychain===void 0)return n.refreshToken===void 0?void 0:{...n,refreshToken:n.refreshToken};const o=await U(e,n.keychain,r||t>0);if(o){const{access:i,refreshToken:a}=o;return{...n,refreshToken:a,...i?{access:i}:{}}}await new Promise(i=>setTimeout(i,l.stepMs))}}export async function writeCredentials(e,r){const{refreshToken:t,access:n,...o}=r,i={version:o.version,url:o.url,issuer:o.issuer,account:o.account,since:o.since};let a={...i,refreshToken:t,...n?{access:n}:{}};if(e.keychain){const c={revision:S(9).toString("base64url"),refreshToken:t,...n?{access:n}:{}},_=JSON.stringify(c);try{if(await e.keychain.set(_),await e.keychain.get()!==_)throw new Error(`${e.keychain.name} did not keep the sign-in.`);h.set(e.credentialsFile,c),a={...i,keychain:c.revision}}catch{}}const u=e.credentialsFile;await p(A(u),{recursive:!0,mode:448});const s=`${u}.${S(6).toString("hex")}.tmp`;try{await F(s,`${JSON.stringify(a,null,2)}
3
- `,{mode:384}),await $(s,384),await E(s,u)}finally{await w(s,{force:!0})}}export async function forgetCredentials(e,r){if(r!==void 0){const t=await readCredentials(e,!0);if(t!==void 0&&t.refreshToken!==r)return}await w(e.credentialsFile,{force:!0}),h.delete(e.credentialsFile),await e.keychain?.delete().catch(()=>{})}async function y(e,r){const t=`${e}.lock`;await p(A(e),{recursive:!0,mode:448});const n=Date.now()+l.waitMs;for(;;)try{await p(t);break}catch{const o=await D(t).catch(()=>{});if(o&&Date.now()-o.mtimeMs>l.staleMs){await w(t,{recursive:!0,force:!0});continue}if(Date.now()>n)throw new Error("Another AllyHub program holds the sign-in's lock.");await new Promise(i=>setTimeout(i,l.stepMs))}try{return await r()}finally{await w(t,{recursive:!0,force:!0})}}async function f(e,r,t,n){return e.fetch(r,{method:"POST",redirect:"error",headers:{"content-type":"application/x-www-form-urlencoded",accept:"application/json"},body:new URLSearchParams(t).toString(),signal:n??AbortSignal.timeout(3e4)})}async function g(e){const r=await e.json().catch(()=>({}));if(e.ok)return N.parse(r);const t=j.safeParse(r);return{error:t.success?t.data.error:`http_${String(e.status)}`}}const v=e=>({token:e.access_token,expiresAt:new Date(Date.now()+e.expires_in*1e3).toISOString()});export async function accountOf(e,r){const t=await e.fetch(`${e.url}${H}`,{redirect:"error",headers:{authorization:`Bearer ${r}`,accept:"application/json"},signal:AbortSignal.timeout(3e4)});if(t.status===401)throw new SignedOut("This computer is signed out of AllyHub.");if(!t.ok)throw new Error(`Reading the account: AllyHub answered ${String(t.status)}.`);const n=await t.json();return M.parse({id:n.id,email:n.email,...n.name?{name:n.name}:{},...n.organization?{organization:n.organization}:{}})}async function b(e,r){if(r.refresh_token===void 0)throw new Error("AllyHub gave no refresh token.");const t=await authServer(e),n={version:1,url:e.url,issuer:t.issuer,account:await accountOf(e,r.access_token),refreshToken:r.refresh_token,access:v(r),since:new Date().toISOString()},o=await readCredentials(e).catch(()=>{});return await writeCredentials(e,n),o!==void 0&&o.refreshToken!==n.refreshToken&&await O(e,t.revocation_endpoint,o.refreshToken).then(i=>i.body?.cancel()).catch(()=>{}),n}const O=(e,r,t)=>f(e,r,{token:t,token_type_hint:"refresh_token",client_id:d});export async function signInWithCode(e,r){const t=await authServer(e),n=await g(await f(e,t.token_endpoint,{grant_type:"authorization_code",client_id:d,code:r.code,redirect_uri:r.redirectUri,code_verifier:r.codeVerifier,resource:e.url}));if("error"in n)throw new Error(`Signing in: AllyHub refused the code (${n.error}).`);return b(e,n)}export async function signInWithDevice(e,r,t){const n=await authServer(e),o=await f(e,n.device_authorization_endpoint,{client_id:d,scope:I,resource:e.url});if(!o.ok)throw new Error(`Asking for a device's code: AllyHub answered ${String(o.status)}.`);const i=P.parse(await o.json());r(i);let a=(i.interval??5)*1e3;const u=Date.now()+i.expires_in*1e3;for(;Date.now()<u;){if(await new Promise(c=>setTimeout(c,a)),t?.aborted===!0)throw new Error("Signing in was stopped.");const s=await g(await f(e,n.token_endpoint,{grant_type:"urn:ietf:params:oauth:grant-type:device_code",client_id:d,device_code:i.device_code,resource:e.url}));if(!("error"in s))return b(e,s);if(s.error!=="authorization_pending"){if(s.error==="slow_down"){a+=5e3;continue}throw new Error(s.error==="access_denied"?"The sign-in was turned down.":`Signing in: AllyHub refused (${s.error}).`)}}throw new Error("The device's code ran out before it was entered.")}export async function accessOf(e,r={}){const t=a=>a?.access!==void 0&&a.access.token!==r.refused&&Date.parse(a.access.expiresAt)-J>Date.now()?{token:a.access.token,expiresAt:a.access.expiresAt,credentials:a}:void 0;let n=await readCredentials(e);if(!n||(e.keychain&&n.keychain===void 0&&(n=await y(e.credentialsFile,async()=>{const a=await readCredentials(e,!0);return a&&a.keychain===void 0&&await writeCredentials(e,a),a})),!n))return;const o=t(n);if(o)return o;const i=await authServer(e);return y(e.credentialsFile,async()=>{const a=await readCredentials(e,!0);if(!a)return;const u=t(a);if(u)return u;const s=await g(await f(e,i.token_endpoint,{grant_type:"refresh_token",client_id:d,refresh_token:a.refreshToken,resource:e.url}));if("error"in s)throw s.error==="invalid_grant"?(await forgetCredentials(e,a.refreshToken),new SignedOut("This computer is signed out of AllyHub.")):new Error(`Renewing the sign-in: AllyHub answered ${s.error}.`);const c={...a,refreshToken:s.refresh_token??a.refreshToken,access:v(s)};return await writeCredentials(e,c),{token:c.access?.token??s.access_token,expiresAt:c.access?.expiresAt??"",credentials:c}})}export async function signOut(e,r){await forgetCredentials(e,r.refreshToken);const t=await authServer(e),n=await O(e,t.revocation_endpoint,r.refreshToken);if(await n.body?.cancel(),!n.ok&&n.status!==400)throw new Error(`Signing out: AllyHub answered ${String(n.status)}.`)}export async function chooseOrganization(e,r){await y(e.credentialsFile,async()=>{const t=await readCredentials(e,!0);if(!t)throw R();await writeCredentials(e,{...t,account:{...t.account,organization:r}})})}
2
+ import{randomBytes as T}from"node:crypto";import{chmod as C,mkdir as m,readFile as b,rename as P,rm as h,stat as O,writeFile as z}from"node:fs/promises";import{dirname as x}from"node:path";import*as y from"zod";import{ACCOUNT_PATH as I,AccountSchema as j,AuthServerSchema as N,CLIENT_ID as w,CredentialsFileSchema as $,DeviceAuthorizationSchema as R,METADATA_PATH as J,OAuthErrorSchema as L,SCOPES as U,TokenResponseSchema as B}from"@allyhub/protocol";import{deviceHeaders as W,newDeviceId as E}from"./device.js";import{notSignedIn as G}from"./errors.js";export class SignedOut extends Error{}const K=6e4,p={waitMs:15e3,staleMs:3e4,stepMs:50},g=new Map;export function authServer(e){let n=g.get(e.url);return n||(n=(async()=>{const t=await e.fetch(`${e.url}${J}`,{redirect:"error",headers:{accept:"application/json"},signal:AbortSignal.timeout(3e4)});if(!t.ok)throw new Error(`AllyHub's sign-in metadata answered ${String(t.status)}.`);return N.parse(await t.json())})(),n.catch(()=>g.delete(e.url)),g.set(e.url,n)),n}const V=y.object({revision:y.string().min(1),refreshToken:y.string().min(1),access:$.shape.access}),k=new Map;async function q(e,n,t){const r=k.get(e.credentialsFile);if(!t&&r?.revision===n)return r;if(e.keychain)try{const i=await e.keychain.get(),a=V.safeParse(i===void 0?void 0:JSON.parse(i));return!a.success||a.data.revision!==n?void 0:(k.set(e.credentialsFile,a.data),a.data)}catch{return}}export async function readCredentials(e,n=!1){for(let t=0;t<3;t+=1){let r;try{const a=$.safeParse(JSON.parse(await b(e.credentialsFile,"utf8")));if(!a.success||a.data.url!==e.url)return;r=a.data}catch{return}if(r.keychain===void 0)return r.refreshToken===void 0?void 0:{...r,refreshToken:r.refreshToken};const i=await q(e,r.keychain,n||t>0);if(i){const{access:a,refreshToken:o}=i;return{...r,refreshToken:o,...a?{access:a}:{}}}await new Promise(a=>setTimeout(a,p.stepMs))}}export async function writeCredentials(e,n){const{refreshToken:t,access:r,...i}=n,a={version:i.version,url:i.url,issuer:i.issuer,account:i.account,since:i.since};let o={...a,refreshToken:t,...r?{access:r}:{}};if(e.keychain){const f={revision:T(9).toString("base64url"),refreshToken:t,...r?{access:r}:{}},A=JSON.stringify(f);try{if(await e.keychain.set(A),await e.keychain.get()!==A)throw new Error(`${e.keychain.name} did not keep the sign-in.`);k.set(e.credentialsFile,f),o={...a,keychain:f.revision}}catch{}}const d=e.credentialsFile,u=`${JSON.stringify(o,null,2)}
3
+ `,c=await O(d).catch(()=>{});if(c!==void 0&&(c.mode&511)===384&&await b(d,"utf8").catch(()=>{})===u)return;await m(x(d),{recursive:!0,mode:448});const s=`${d}.${T(6).toString("hex")}.tmp`;try{await z(s,u,{mode:384}),await C(s,384),await P(s,d)}finally{await h(s,{force:!0})}}export async function forgetCredentials(e,n){if(n!==void 0){const t=await readCredentials(e,!0);if(t!==void 0&&t.refreshToken!==n)return}await h(e.credentialsFile,{force:!0}),k.delete(e.credentialsFile),await e.keychain?.delete().catch(()=>{})}async function _(e,n){const t=`${e}.lock`;await m(x(e),{recursive:!0,mode:448});const r=Date.now()+p.waitMs;for(;;)try{await m(t);break}catch{const i=await O(t).catch(()=>{});if(i&&Date.now()-i.mtimeMs>p.staleMs){await h(t,{recursive:!0,force:!0});continue}if(Date.now()>r)throw new Error("Another AllyHub program holds the sign-in's lock.");await new Promise(a=>setTimeout(a,p.stepMs))}try{return await n()}finally{await h(t,{recursive:!0,force:!0})}}async function l(e,n,t,r,i={}){return e.fetch(n,{method:"POST",redirect:"error",headers:{...i,"content-type":"application/x-www-form-urlencoded",accept:"application/json"},body:new URLSearchParams(t).toString(),signal:r??AbortSignal.timeout(3e4)})}async function S(e){const n=await e.json().catch(()=>({}));if(e.ok)return B.parse(n);const t=L.safeParse(n);return{error:t.success?t.data.error:`http_${String(e.status)}`}}const D=e=>({token:e.access_token,expiresAt:new Date(Date.now()+e.expires_in*1e3).toISOString()});export async function accountOf(e,n){const t=await e.fetch(`${e.url}${I}`,{redirect:"error",headers:{authorization:`Bearer ${n}`,accept:"application/json"},signal:AbortSignal.timeout(3e4)});if(t.status===401)throw new SignedOut("This computer is signed out of AllyHub.");if(!t.ok)throw new Error(`Reading the account: AllyHub answered ${String(t.status)}.`);const r=await t.json();return j.parse({id:r.id,email:r.email,...r.name?{name:r.name}:{},...r.organization?{organization:r.organization}:{}})}const Q=e=>e.client??"AllyHub",v=(e,n)=>W(Q(e),n),F=async e=>(await readCredentials(e).catch(()=>{}))?.device??E();async function H(e,n,t){if(n.refresh_token===void 0)throw new Error("AllyHub gave no refresh token.");const r=await authServer(e),i={version:1,url:e.url,issuer:r.issuer,account:await accountOf(e,n.access_token),refreshToken:n.refresh_token,access:D(n),since:new Date().toISOString(),device:t},a=await readCredentials(e).catch(()=>{});return await writeCredentials(e,i),a!==void 0&&a.refreshToken!==i.refreshToken&&await M(e,r.revocation_endpoint,a.refreshToken).then(o=>o.body?.cancel()).catch(()=>{}),i}const M=(e,n,t)=>l(e,n,{token:t,token_type_hint:"refresh_token",client_id:w});export async function signInWithCode(e,n){const t=await authServer(e),r=await F(e),i=await S(await l(e,t.token_endpoint,{grant_type:"authorization_code",client_id:w,code:n.code,redirect_uri:n.redirectUri,code_verifier:n.codeVerifier,resource:e.url},void 0,await v(e,r)));if("error"in i)throw new Error(`Signing in: AllyHub refused the code (${i.error}).`);return H(e,i,r)}export async function signInWithDevice(e,n,t){const r=await authServer(e),i=await l(e,r.device_authorization_endpoint,{client_id:w,scope:U,resource:e.url});if(!i.ok)throw new Error(`Asking for a device's code: AllyHub answered ${String(i.status)}.`);const a=R.parse(await i.json()),o=await F(e),d=await v(e,o);n(a);let u=(a.interval??5)*1e3;const c=Date.now()+a.expires_in*1e3;for(;Date.now()<c;){if(await new Promise(f=>setTimeout(f,u)),t?.aborted===!0)throw new Error("Signing in was stopped.");const s=await S(await l(e,r.token_endpoint,{grant_type:"urn:ietf:params:oauth:grant-type:device_code",client_id:w,device_code:a.device_code,resource:e.url},void 0,d));if(!("error"in s))return H(e,s,o);if(s.error!=="authorization_pending"){if(s.error==="slow_down"){u+=5e3;continue}throw new Error(s.error==="access_denied"?"The sign-in was turned down.":`Signing in: AllyHub refused (${s.error}).`)}}throw new Error("The device's code ran out before it was entered.")}export async function accessOf(e,n={}){const t=o=>o?.access!==void 0&&o.access.token!==n.refused&&Date.parse(o.access.expiresAt)-K>Date.now()?{token:o.access.token,expiresAt:o.access.expiresAt,credentials:o}:void 0;let r=await readCredentials(e);if(!r||(e.keychain&&r.keychain===void 0&&(r=await _(e.credentialsFile,async()=>{const o=await readCredentials(e,!0);return o&&o.keychain===void 0&&await writeCredentials(e,o),o})),!r))return;const i=t(r);if(i)return i;const a=await authServer(e);return _(e.credentialsFile,async()=>{const o=await readCredentials(e,!0);if(!o)return;const d=t(o);if(d)return d;const u=o.device??E(),c=await S(await l(e,a.token_endpoint,{grant_type:"refresh_token",client_id:w,refresh_token:o.refreshToken,resource:e.url},void 0,await v(e,u)));if("error"in c)throw c.error==="invalid_grant"?(await forgetCredentials(e,o.refreshToken),new SignedOut("This computer is signed out of AllyHub.")):new Error(`Renewing the sign-in: AllyHub answered ${c.error}.`);const s={...o,refreshToken:c.refresh_token??o.refreshToken,access:D(c),device:u};return await writeCredentials(e,s),{token:s.access?.token??c.access_token,expiresAt:s.access?.expiresAt??"",credentials:s}})}export async function signOut(e,n){await forgetCredentials(e,n.refreshToken);const t=await authServer(e),r=await M(e,t.revocation_endpoint,n.refreshToken);if(await r.body?.cancel(),!r.ok&&r.status!==400)throw new Error(`Signing out: AllyHub answered ${String(r.status)}.`)}export async function chooseOrganization(e,n){await _(e.credentialsFile,async()=>{const t=await readCredentials(e,!0);if(!t)throw G();await writeCredentials(e,{...t,account:{...t.account,organization:n}})})}
@@ -0,0 +1,12 @@
1
+ /** The computer's name and system. */
2
+ export interface Computer {
3
+ name: string;
4
+ os: string;
5
+ }
6
+ /** This computer, read once per process. */
7
+ export declare function thisComputer(): Promise<Computer>;
8
+ /** A new sign-in's id (DEVICE_HEADER). */
9
+ export declare const newDeviceId: () => string;
10
+ /** What a token request says of the computer, for the sign-in `device`, from the program `client` ("AllyHub-Studio/0.9.1"). */
11
+ export declare function deviceHeaders(client: string, device: string): Promise<Record<string, string>>;
12
+ //# sourceMappingURL=device.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{execFile as u}from"node:child_process";import{randomBytes as l}from"node:crypto";import{arch as p,hostname as d,platform as s,release as r}from"node:os";import{DEVICE_HEADER as w,DEVICE_NAME_HEADER as f}from"@allyhub/protocol";const a=(e,t)=>new Promise(n=>{u(e,t,{timeout:2e3},(m,c)=>{const o=c.trim();n(m===null&&o!==""?o:void 0)})});let i;export function thisComputer(){return i??=(async()=>{const e=d().replace(/\.local$/u,"");switch(s()){case"darwin":{const[t,n]=await Promise.all([a("/usr/sbin/scutil",["--get","ComputerName"]),a("/usr/bin/sw_vers",["-productVersion"])]);return{name:t??e,os:`macOS ${n??r()}`}}case"win32":return{name:e,os:`Windows ${r()}`};case"linux":return{name:e,os:`Linux ${r()}`};default:return{name:e,os:`${s()} ${r()}`}}})(),i}export const newDeviceId=()=>l(18).toString("base64url");export async function deviceHeaders(e,t){const n=await thisComputer();return{"user-agent":`${e} (${n.os}; ${p()})`,[w]:t,[f]:encodeURIComponent(n.name)}}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/cloud",
3
- "version": "0.9.0",
3
+ "version": "0.11.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/components",
3
- "version": "0.9.0",
3
+ "version": "0.11.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./src/index.ts",
@@ -12,7 +12,7 @@
12
12
  {
13
13
  "path": "src/callout.ts",
14
14
  "target": "{dir}/callout.ts",
15
- "sha256": "97b10557993e74692626dd569d5d05a9df834da79fa645b641d821174714e6e4"
15
+ "sha256": "c1dc30bcbe0766d05c60215af16a4f82548b465d7948fadb203182737a01e610"
16
16
  }
17
17
  ],
18
18
  "categories": []
@@ -697,16 +697,99 @@ const seconds = (v: Time | undefined): number | undefined =>
697
697
  typeof v === "number" && Number.isFinite(v) ? v : undefined;
698
698
 
699
699
  let fontCanvas: CanvasRenderingContext2D | null | undefined;
700
+ let inkOf: InkOf | undefined;
701
+
702
+ /** A glyph's ink in ems from its pen position: how far above the baseline it reaches, where it starts and ends, and its advance. */
703
+ export interface GlyphInk {
704
+ top: number;
705
+ left: number;
706
+ right: number;
707
+ advance: number;
708
+ }
709
+
710
+ /** A font's face: its style, weight and family, at any size. */
711
+ export type TextFace = Pick<
712
+ CSSStyleDeclaration,
713
+ "fontStyle" | "fontWeight" | "fontFamily"
714
+ >;
715
+
716
+ /** Measures a glyph's ink in a face. */
717
+ export type InkOf = (face: TextFace, glyph: string) => GlyphInk | undefined;
718
+
719
+ /**
720
+ * Measures glyphs' ink by drawing them, each once per font. A canvas's
721
+ * `actualBoundingBox*` is not the ink: Chrome on Linux rounds it to whole
722
+ * pixels below 240px and to 1/64 of an em above (a capital's top 1.5px off
723
+ * at 120px). Drawn at 256px, with a pixel's coverage taken as the share of
724
+ * it inside the outline, the ink is within a few thousandths of an em.
725
+ * Self-contained, so it can be shown to a page as source.
726
+ */
727
+ export function glyphInk(): InkOf {
728
+ const R = 256;
729
+ const ox = R;
730
+ const oy = 1.5 * R;
731
+ const kept = new Map<string, GlyphInk | undefined>();
732
+ let g: CanvasRenderingContext2D | null | undefined;
733
+ return (face, glyph) => {
734
+ const font = `${face.fontStyle} ${face.fontWeight} ${String(R)}px ${face.fontFamily}`;
735
+ const key = `${font}\n${glyph}`;
736
+ if (kept.has(key)) return kept.get(key);
737
+ if (g === undefined) {
738
+ const c = document.createElement("canvas");
739
+ c.width = 3 * R;
740
+ c.height = 2 * R;
741
+ g = c.getContext("2d", { willReadFrequently: true });
742
+ }
743
+ let ink: GlyphInk | undefined;
744
+ if (g) {
745
+ const { width: W, height: H } = g.canvas;
746
+ g.clearRect(0, 0, W, H);
747
+ g.font = font;
748
+ g.textBaseline = "alphabetic";
749
+ g.fillStyle = "#000";
750
+ g.fillText(glyph, ox, oy);
751
+ const a = g.getImageData(0, 0, W, H).data;
752
+ const row = new Float64Array(H);
753
+ const col = new Float64Array(W);
754
+ for (let y = 0; y < H; y++) {
755
+ for (let x = 0; x < W; x++) {
756
+ const v = a[(y * W + x) * 4 + 3] ?? 0;
757
+ if (v > (row[y] ?? 0)) row[y] = v;
758
+ if (v > (col[x] ?? 0)) col[x] = v;
759
+ }
760
+ }
761
+ const t = row.findIndex((v) => v > 0);
762
+ const l = col.findIndex((v) => v > 0);
763
+ const r = col.findLastIndex((v) => v > 0);
764
+ if (t >= 0 && l >= 0 && r >= 0) {
765
+ // An edge's pixel is covered as far as the outline reaches into it.
766
+ const top = t + 1 - (row[t] ?? 0) / 255;
767
+ const left = l + 1 - (col[l] ?? 0) / 255;
768
+ const right = r + (col[r] ?? 0) / 255;
769
+ ink = {
770
+ top: (oy - top) / R,
771
+ left: (left - ox) / R,
772
+ right: (right - ox) / R,
773
+ advance: g.measureText(glyph).width / R,
774
+ };
775
+ }
776
+ }
777
+ kept.set(key, ink);
778
+ return ink;
779
+ };
780
+ }
700
781
 
701
782
  /**
702
783
  * The box an element's text reads as, in client pixels: from its capitals'
703
784
  * tops (the font's cap height above the baseline, lowercase text too) to
704
785
  * its baseline, and from its first glyph's ink to its last's. `g` measures
705
- * the fonts. Undefined when it has no text.
786
+ * the fonts' ascent and descent, `ink` the glyphs' ink. Undefined when it
787
+ * has no text.
706
788
  */
707
789
  export function textBoxOf(
708
790
  node: Element,
709
791
  g: CanvasRenderingContext2D,
792
+ ink: InkOf,
710
793
  ): DOMRect | undefined {
711
794
  const walk = document.createTreeWalker(node, NodeFilter.SHOW_TEXT);
712
795
  let x0 = Infinity;
@@ -719,11 +802,12 @@ export function textBoxOf(
719
802
  if (from < 0 || !n.parentElement) continue;
720
803
  const to = text.trimEnd().length;
721
804
  const cs = getComputedStyle(n.parentElement);
805
+ const size = parseFloat(cs.fontSize);
722
806
  g.font = `${cs.fontStyle} ${cs.fontWeight} ${cs.fontSize} ${cs.fontFamily}`;
723
807
  const H = g.measureText("H");
724
808
  const up = H.fontBoundingBoxAscent;
725
809
  const tall = up + H.fontBoundingBoxDescent;
726
- const cap = H.actualBoundingBoxAscent;
810
+ const cap = (ink(cs, "H")?.top ?? H.actualBoundingBoxAscent / size) * size;
727
811
  const range = document.createRange();
728
812
  range.setStart(n, from);
729
813
  range.setEnd(n, to);
@@ -732,7 +816,7 @@ export function textBoxOf(
732
816
  );
733
817
  const first = lines[0];
734
818
  const last = lines.at(-1);
735
- if (!first || !last || !(tall > 0)) continue;
819
+ if (!first || !last || !(tall > 0) || !(size > 0)) continue;
736
820
  for (const r of lines) {
737
821
  // A line's box is the font's ascent and descent, scaled as it is.
738
822
  const k = r.height / tall;
@@ -740,15 +824,13 @@ export function textBoxOf(
740
824
  y0 = Math.min(y0, baseline - cap * k);
741
825
  y1 = Math.max(y1, baseline);
742
826
  }
743
- const head = g.measureText(text.charAt(from));
744
- const tail = g.measureText(text.charAt(to - 1));
745
- const kf = first.height / tall;
746
- const kl = last.height / tall;
747
- x0 = Math.min(x0, first.left - head.actualBoundingBoxLeft * kf);
748
- x1 = Math.max(
749
- x1,
750
- last.right - (tail.width - tail.actualBoundingBoxRight) * kl,
751
- );
827
+ // A glyph that draws nothing ends where its advance does.
828
+ const head = ink(cs, text.charAt(from));
829
+ const tail = ink(cs, text.charAt(to - 1));
830
+ const kf = (first.height / tall) * size;
831
+ const kl = (last.height / tall) * size;
832
+ x0 = Math.min(x0, first.left + (head ? head.left : 0) * kf);
833
+ x1 = Math.max(x1, last.right - (tail ? tail.advance - tail.right : 0) * kl);
752
834
  }
753
835
  return x1 > x0 && y1 > y0 ? new DOMRect(x0, y0, x1 - x0, y1 - y0) : undefined;
754
836
  }
@@ -778,8 +860,11 @@ function placeOf(
778
860
  }
779
861
  if (!node || root.contains(node)) return undefined;
780
862
  fontCanvas ??= document.createElement("canvas").getContext("2d");
863
+ inkOf ??= glyphInk();
781
864
  const text =
782
- fit === "text" && fontCanvas ? textBoxOf(node, fontCanvas) : undefined;
865
+ fit === "text" && fontCanvas
866
+ ? textBoxOf(node, fontCanvas, inkOf)
867
+ : undefined;
783
868
  const r = text ?? node.getBoundingClientRect();
784
869
  if (!(r.width > 0) || !(r.height > 0)) return undefined;
785
870
  // The stage may be shown at another size (a preview zooms it): measure
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{randomBytes as d}from"node:crypto";import{basename as f,join as n}from"node:path";import{exportProject as m}from"@allyhub/export";import{JobFailure as p}from"@allyhub/jobs";import{OUT_DIR as u}from"@allyhub/formats";import{parseCombo as w}from"@allyhub/project";import{projectPathOf as g}from"./paths.js";export class Exports{root;changed;jobs=[];aborts=new Map;queue=Promise.resolve();asJobs;kinds;processors;analyses;constructor(t,r,s,a,e={}){this.root=t,this.kinds=r,this.processors=e.processors??[],this.analyses=e.analyses??[],this.changed=s,this.asJobs=a}list(){return this.jobs.map(t=>({...t}))}start(t,r,s,a){const e={id:`x${d(4).toString("hex")}`,item:t,versions:r,types:s,...a?{options:a}:{},state:"queued",progress:0,files:[]};this.jobs.push(e);const o=new AbortController;return this.aborts.set(e.id,o),this.changed({...e}),this.queue=this.queue.then(()=>this.run(e,o.signal)),{...e}}cancel(t){const r=this.jobs.find(s=>s.id===t);return!r||r.state==="done"||r.state==="failed"?!1:(this.aborts.get(t)?.abort(),this.set(r,{state:"cancelled"}),!0)}idle(){return this.queue}async close(){for(const t of this.aborts.values())t.abort();await this.queue}watchers=new Set;set(t,r){Object.assign(t,r),this.changed({...t});for(const s of this.watchers)s(t)}async run(t,r){if(t.state==="cancelled")return;const s=this.asJobs;if(s===void 0)return this.make(t,r);const a=await s.nameOf(t.item).catch(()=>f(t.item));let e=0;const o=async()=>{await this.queue;const i=new AbortController;return this.aborts.set(t.id,i),delete t.error,this.set(t,{state:"queued",progress:0,files:[]}),i.signal};await s.jobs.run({about:{kind:"piece",id:n(this.root,t.item)},what:"export",name:a,unit:"share",total:1},async i=>{i.signal.addEventListener("abort",()=>{this.cancel(t.id)});const h=l=>{l.id===t.id&&i.report(l.progress,1)};this.watchers.add(h);try{await this.make(t,e++===0?r:await o())}finally{this.watchers.delete(h)}if(t.state==="cancelled")throw new DOMException("The export was cancelled.","AbortError");if(t.state==="failed")throw new p("other",t.error??"The export failed.");const[c]=t.files;c!==void 0&&i.made(n(this.root,c))}).catch(()=>{})}async make(t,r){this.set(t,{state:"running"});try{const s=await m({root:this.root,kinds:this.kinds,processors:this.processors,analyses:this.analyses,items:[t.item],...t.versions.length?{combos:t.versions.map(e=>w(e))}:{},...t.types.length?{types:t.types}:{},...t.options?{params:t.options}:{},out:n(this.root,u),signal:r,onProgress:e=>{r.aborted||this.set(t,{progress:Math.max(t.progress,Math.min(1,e))})}}),a=s.files.flatMap(e=>e.files).map(e=>g(this.root,e)).filter(e=>e!==void 0);r.aborted?this.set(t,{state:"cancelled",files:a}):s.failed.length>0&&a.length===0?this.set(t,{state:"failed",error:s.failed.map(e=>e.message).join(" ")}):this.set(t,{state:"done",progress:1,files:a,...s.failed.length>0?{error:[...new Map(s.failed.map(e=>[e.code,e.message])).values()].join(" ")}:{}})}catch(s){this.set(t,{state:r.aborted?"cancelled":"failed",...r.aborted?{}:{error:s instanceof Error?s.message:String(s)}})}finally{this.aborts.delete(t.id)}}}
2
+ import{randomBytes as u}from"node:crypto";import{constants as m}from"node:fs";import{copyFile as p,link as w,mkdir as g,rm as y}from"node:fs/promises";import{basename as f,extname as v,join as c}from"node:path";import{exportProject as x}from"@allyhub/export";import{JobFailure as E}from"@allyhub/jobs";import{OUT_DIR as k}from"@allyhub/formats";import{parseCombo as T}from"@allyhub/project";import{projectPathOf as q}from"./paths.js";export class Exports{root;changed;jobs=[];aborts=new Map;queue=Promise.resolve();asJobs;kinds;processors;analyses;saveTo;saved=new Map;constructor(t,r,e,a,s={}){this.root=t,this.kinds=r,this.processors=s.processors??[],this.analyses=s.analyses??[],this.saveTo=s.saveTo,this.changed=e,this.asJobs=a}list(){return this.jobs.map(t=>({...t}))}start(t,r,e,a){const s={id:`x${u(4).toString("hex")}`,item:t,versions:r,types:e,...a?{options:a}:{},state:"queued",progress:0,files:[]};this.jobs.push(s);const i=new AbortController;return this.aborts.set(s.id,i),this.changed({...s}),this.queue=this.queue.then(()=>this.run(s,i.signal)),{...s}}cancel(t){const r=this.jobs.find(e=>e.id===t);return!r||r.state==="done"||r.state==="failed"?!1:(this.aborts.get(t)?.abort(),this.set(r,{state:"cancelled"}),!0)}savedOf(t){return this.saved.get(t)}idle(){return this.queue}async close(){for(const t of this.aborts.values())t.abort();await this.queue}watchers=new Set;set(t,r){Object.assign(t,r),this.changed({...t});for(const e of this.watchers)e(t)}async run(t,r){if(t.state==="cancelled")return;const e=this.asJobs;if(e===void 0)return this.make(t,r);const a=await e.nameOf(t.item).catch(()=>f(t.item));let s=0;const i=async()=>{await this.queue;const n=new AbortController;return this.aborts.set(t.id,n),delete t.error,this.set(t,{state:"queued",progress:0,files:[]}),n.signal};await e.jobs.run({about:{kind:"piece",id:c(this.root,t.item)},what:"export",name:a,unit:"share",total:1},async n=>{n.signal.addEventListener("abort",()=>{this.cancel(t.id)});const d=l=>{l.id===t.id&&n.report(l.progress,1)};this.watchers.add(d);try{await this.make(t,s++===0?r:await i())}finally{this.watchers.delete(d)}if(t.state==="cancelled")throw new DOMException("The export was cancelled.","AbortError");if(t.state==="failed")throw new E("other",t.error??"The export failed.");const[h]=t.files;h!==void 0&&n.made(this.saved.get(h)??c(this.root,h))}).catch(()=>{})}async save(t){const r=this.saveTo?.();if(r===void 0)return[];try{await g(r,{recursive:!0});for(const e of t)this.saved.set(e,await $(c(this.root,e),r));return[]}catch(e){return[`Not saved in ${r}: ${e instanceof Error?e.message:String(e)}`]}}async make(t,r){this.set(t,{state:"running"});try{const e=await x({root:this.root,kinds:this.kinds,processors:this.processors,analyses:this.analyses,items:[t.item],...t.versions.length?{combos:t.versions.map(s=>T(s))}:{},...t.types.length?{types:t.types}:{},...t.options?{params:t.options}:{},out:c(this.root,k),signal:r,onProgress:s=>{r.aborted||this.set(t,{progress:Math.max(t.progress,Math.min(1,s))})}}),a=e.files.flatMap(s=>s.files).map(s=>q(this.root,s)).filter(s=>s!==void 0);if(r.aborted)this.set(t,{state:"cancelled",files:a});else if(e.failed.length>0&&a.length===0)this.set(t,{state:"failed",error:e.failed.map(s=>s.message).join(" ")});else{const s=[...new Map(e.failed.map(i=>[i.code,i.message])).values(),...await this.save(a)];this.set(t,{state:"done",progress:1,files:a,...s.length>0?{error:s.join(" ")}:{}})}}catch(e){this.set(t,{state:r.aborted?"cancelled":"failed",...r.aborted?{}:{error:e instanceof Error?e.message:String(e)}})}finally{this.aborts.delete(t.id)}}}async function $(o,t){const r=v(o),e=f(o,r);for(let a=0;;a++){const s=c(t,a===0?`${e}${r}`:`${e} (${String(a)})${r}`);try{await w(o,s).catch(i=>{if(i.code==="EEXIST")throw i;return p(o,s,m.COPYFILE_EXCL)})}catch(i){if(i.code==="EEXIST")continue;throw i}return await y(o,{force:!0}),s}}
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- export{PING_MS,RAW_PATH,RPC_PATH,forwardedHost,startDevServer}from"./server.js";export{ProjectServer,SERVER_METHODS}from"./project.js";export{Writer,LIST_LIMIT,UPLOAD_MAX_BYTES}from"./writer.js";export{Watcher}from"./watcher.js";export{Presence}from"./presence.js";export{changedLines}from"./texts.js";export{writeProblems,dataFileOf}from"./validate.js";export{pathProblem,versionOf}from"./paths.js";export{SETTLE_MS}from"./background.js";export{recordTree}from"./record.js";export{itemPreview,projectName}from"./card.js";export{hasFileManager,revealFile}from"./reveal.js";
2
+ export{PING_MS,RAW_PATH,RPC_PATH,forwardedHost,startDevServer}from"./server.js";export{ProjectServer,SERVER_METHODS}from"./project.js";export{Writer,LIST_LIMIT,UPLOAD_MAX_BYTES}from"./writer.js";export{Watcher}from"./watcher.js";export{Presence}from"./presence.js";export{changedLines}from"./texts.js";export{writeProblems,dataFileOf}from"./validate.js";export{pathProblem,versionOf}from"./paths.js";export{SETTLE_MS}from"./background.js";export{recordTree}from"./record.js";export{itemPreview,projectName}from"./card.js";export{downloadsFolder,hasFileManager,revealFile}from"./reveal.js";
@@ -0,0 +1,2 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ import{listsFile as c}from"@allyhub/formats";const l=(d,t)=>d===""||d.endsWith("/")?t.startsWith(d):d===t;export class Inputs{recorded=new Map;set(t,s,o){let e=this.recorded.get(t);e||(e=new Map,this.recorded.set(t,e)),e.set(s,new Set(o))}add(t,s,o){const e=this.recorded.get(t)?.get(s);e?e.add(o):this.set(t,s,[o])}of(t){const s=new Set;for(const o of this.recorded.get(t)?.values()??[])for(const e of o)s.add(e);return s}affected(t,s){const o=new Map;for(const e of t){const f=[...this.of(e.id)],n=s.filter(r=>r===e.entry||e.files!==void 0&&c(e.files,r)||f.some(i=>l(i,r)));n.length>0&&o.set(e.id,n)}return o}}
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{rm as f}from"node:fs/promises";import{join as u}from"node:path";import{startBrowser as m}from"@allyhub/browser";import{kindBuildOf as w,mediaHref as v,nodeLending as b,projectItems as g,sourceOf as k,stageItem as S}from"@allyhub/build";import{CACHE_DIR as y}from"@allyhub/formats";import{CheckSession as D,ProjectError as R,pickTarget as E,parseCombo as O}from"@allyhub/project";import{RPC_ERROR as h,RpcError as c,SNAPSHOT_TREE as l}from"@allyhub/protocol";import{prepareStage as $,viewStage as C}from"@allyhub/stage";import{Routes as P}from"./routes.js";export function rpcErrorOf(o){return o instanceof R?new c(o.kind==="not-found"?h.notFound:h.invalid,o.hint?`${o.message} ${o.hint}`:o.message):o}export class Live{root;buildDir;revision=0;prep;last;lease;old=new Set;browserStarted;gpu;building=Promise.resolve();closed=!1;codes=new Map;kinds;routes;constructor(e,i){this.root=e,this.kinds=i.kinds,this.buildDir=u(e,y,"build",`dev-${String(process.pid)}`),this.gpu=i.gpu,this.routes=new P({root:e,kinds:i.kinds,buildDir:this.buildDir,revision:()=>this.revision,prepared:()=>this.prepared(),latest:()=>this.latest(),view:(t,s)=>C(e,t,s,i.kinds)})}moved(e){this.revision=e,this.lease&&this.lease.revision!==e&&this.retire(this.lease)}prepared(){const e=this.revision;if(this.prep?.revision===e)return this.prep.promise;const i=this.building.then(()=>e===this.revision?this.build():void 0);this.building=i.catch(()=>{});const t=i.then(s=>s??this.prepared());return this.prep={revision:e,promise:t},t.catch(()=>{this.prep?.promise===t&&(this.prep=void 0)}),t}async build(){const e=await $(this.root,this.pieceDir,this.kinds);return this.last=e,e}async itemCode(e){const i=await this.item(e),t=i?await w(this.kinds.find(r=>r.id===i.kind))?.catch(()=>{}):void 0,s=t?.code?.bind(t);if(!i||!s)return{failed:!1};const n=this.codes.get(e),d=n?.revision===this.revision?n.promise:b(this.kinds,this.root).then(r=>s(i,{root:this.root,lend:r})).catch(()=>{});return this.codes.set(e,{revision:this.revision,promise:d}),await d??{failed:!0}}async item(e){const{items:i}=await g(this.root,this.kinds);return i.find(t=>t.id===e)}get pieceDir(){return u(this.buildDir,"stage")}latest(){return this.last}async target(e,i){const t=await this.prepared();try{const{piece:s,target:n}=E(t,e,i===void 0?void 0:[O(i)]);return{prepared:t,piece:s,combo:n.combo}}catch(s){throw rpcErrorOf(s)}}async componentHost(e,i){const t=await this.prepared(),s=t.docs.find(r=>r.place===e||r.file===e);if(s){if(s.components.length===0)throw new c(h.notFound,`${s.place} shows no component.`);const r=t.messages.locales[0];return{prepared:t,host:s,combo:r===void 0?{}:{lang:r}}}const{piece:n,combo:d}=await this.target(e,i);return{prepared:t,host:n,combo:d}}async source(e){const i=await this.prepared(),t=S(i,e);if(!t)throw new c(h.notFound,`No piece ${e}.`);const s=k(i,t),n={...s.media},d=(r,a)=>`${r}${v(a).slice(l.media.length)}`;return await Promise.all(Object.entries(n).map(async([r,a])=>{let p=a;a.kind==="video"&&a.matte===!0&&(p={...p,matteUrl:d(l.matte,r)}),n[r]=await this.routes.mediaOf(r,p)})),{...s,media:n}}browser(){return this.browserStarted??=m(this.gpu===void 0?{}:{gpu:this.gpu}),this.browserStarted}async withSession(e){this.refuseStopped();let i=this.lease;if(i?.revision!==this.revision){i&&this.retire(i);const t=await this.browser();if(this.refuseStopped(),i=this.lease,i?.revision!==this.revision){i&&this.retire(i);const s={revision:this.revision,session:this.prepared().then(n=>D.open({root:this.root,kinds:this.kinds,browser:t,prepared:n})),users:0,retired:!1};i=s,this.lease=s,s.session.catch(()=>{this.lease===s&&(this.lease=void 0)})}}i.users++;try{return await e(await i.session)}finally{i.users--,i.retired&&i.users===0&&this.end(i)}}refuseStopped(){if(this.closed)throw new c(h.unavailable,"allyhub dev is stopping.")}retire(e){e.retired=!0,this.lease===e&&(this.lease=void 0),this.old.add(e),e.users===0&&this.end(e)}end(e){return e.ended??=(async()=>{this.old.delete(e),await e.session.then(i=>i.close()).catch(()=>{})})(),e.ended}async close(){this.closed=!0;const e=[...this.old,...this.lease?[this.lease]:[]];this.lease&&this.retire(this.lease),await Promise.all(e.map(i=>this.end(i))),await this.browserStarted?.then(i=>i.close()).catch(()=>{}),await f(this.buildDir,{recursive:!0,force:!0})}}
2
+ import{rm as f}from"node:fs/promises";import{join as u}from"node:path";import{startBrowser as m}from"@allyhub/browser";import{kindBuildOf as w,mediaHref as v,nodeLending as b,projectItems as g,sourceOf as k,stageItem as S}from"@allyhub/build";import{CACHE_DIR as y}from"@allyhub/formats";import{CheckSession as D,ProjectError as R,pickTarget as E,parseCombo as O}from"@allyhub/project";import{RPC_ERROR as h,RpcError as c,SNAPSHOT_TREE as l}from"@allyhub/protocol";import{prepareStage as $,viewStage as C}from"@allyhub/stage";import{Routes as P}from"./routes.js";export function rpcErrorOf(o){return o instanceof R?new c(o.kind==="not-found"?h.notFound:h.invalid,o.hint?`${o.message} ${o.hint}`:o.message):o}export class Live{root;buildDir;revision=0;prep;last;lease;old=new Set;browserStarted;gpu;building=Promise.resolve();closed=!1;codes=new Map;kinds;routes;constructor(e,i){this.root=e,this.kinds=i.kinds,this.buildDir=u(e,y,"build",`dev-${String(process.pid)}`),this.gpu=i.gpu,this.routes=new P({root:e,kinds:i.kinds,buildDir:this.buildDir,revision:()=>this.revision,prepared:()=>this.prepared(),latest:()=>this.latest(),view:(t,s)=>C(e,t,s,i.kinds),recordInputs:(t,s,n)=>{i.recordInputs?.(t,s,n)}})}moved(e){this.revision=e,this.lease&&this.lease.revision!==e&&this.retire(this.lease)}prepared(){const e=this.revision;if(this.prep?.revision===e)return this.prep.promise;const i=this.building.then(()=>e===this.revision?this.build():void 0);this.building=i.catch(()=>{});const t=i.then(s=>s??this.prepared());return this.prep={revision:e,promise:t},t.catch(()=>{this.prep?.promise===t&&(this.prep=void 0)}),t}async build(){const e=await $(this.root,this.pieceDir,this.kinds);return this.last=e,e}async itemCode(e){const i=await this.item(e),t=i?await w(this.kinds.find(r=>r.id===i.kind))?.catch(()=>{}):void 0,s=t?.code?.bind(t);if(!i||!s)return{failed:!1};const n=this.codes.get(e),d=n?.revision===this.revision?n.promise:b(this.kinds,this.root).then(r=>s(i,{root:this.root,lend:r})).catch(()=>{});return this.codes.set(e,{revision:this.revision,promise:d}),await d??{failed:!0}}async item(e){const{items:i}=await g(this.root,this.kinds);return i.find(t=>t.id===e)}get pieceDir(){return u(this.buildDir,"stage")}latest(){return this.last}async target(e,i){const t=await this.prepared();try{const{piece:s,target:n}=E(t,e,i===void 0?void 0:[O(i)]);return{prepared:t,piece:s,combo:n.combo}}catch(s){throw rpcErrorOf(s)}}async componentHost(e,i){const t=await this.prepared(),s=t.docs.find(r=>r.place===e||r.file===e);if(s){if(s.components.length===0)throw new c(h.notFound,`${s.place} shows no component.`);const r=t.messages.locales[0];return{prepared:t,host:s,combo:r===void 0?{}:{lang:r}}}const{piece:n,combo:d}=await this.target(e,i);return{prepared:t,host:n,combo:d}}async source(e){const i=await this.prepared(),t=S(i,e);if(!t)throw new c(h.notFound,`No piece ${e}.`);const s=k(i,t),n={...s.media},d=(r,a)=>`${r}${v(a).slice(l.media.length)}`;return await Promise.all(Object.entries(n).map(async([r,a])=>{let p=a;a.kind==="video"&&a.matte===!0&&(p={...p,matteUrl:d(l.matte,r)}),n[r]=await this.routes.mediaOf(r,p)})),{...s,media:n}}browser(){return this.browserStarted??=m(this.gpu===void 0?{}:{gpu:this.gpu}),this.browserStarted}async withSession(e){this.refuseStopped();let i=this.lease;if(i?.revision!==this.revision){i&&this.retire(i);const t=await this.browser();if(this.refuseStopped(),i=this.lease,i?.revision!==this.revision){i&&this.retire(i);const s={revision:this.revision,session:this.prepared().then(n=>D.open({root:this.root,kinds:this.kinds,browser:t,prepared:n})),users:0,retired:!1};i=s,this.lease=s,s.session.catch(()=>{this.lease===s&&(this.lease=void 0)})}}i.users++;try{return await e(await i.session)}finally{i.users--,i.retired&&i.users===0&&this.end(i)}}refuseStopped(){if(this.closed)throw new c(h.unavailable,"allyhub dev is stopping.")}retire(e){e.retired=!0,this.lease===e&&(this.lease=void 0),this.old.add(e),e.users===0&&this.end(e)}end(e){return e.ended??=(async()=>{this.old.delete(e),await e.session.then(i=>i.close()).catch(()=>{})})(),e.ended}async close(){this.closed=!0;const e=[...this.old,...this.lease?[this.lease]:[]];this.lease&&this.retire(this.lease),await Promise.all(e.map(i=>this.end(i))),await this.browserStarted?.then(i=>i.close()).catch(()=>{}),await f(this.buildDir,{recursive:!0,force:!0})}}
@@ -0,0 +1,2 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ import{once as y}from"node:events";import{createServer as S}from"node:http";import{posix as v}from"node:path";import{getRequestListener as R}from"@hono/node-server";import{pathProblem as $}from"./paths.js";import{forwarded as x}from"./ports.js";import{fileResponse as P}from"./respond.js";import{inside as U}from"./tree.js";export const PAGE_POLICY=["default-src 'self' data: blob:","script-src 'self' 'unsafe-inline' 'unsafe-eval' blob:","style-src 'self' 'unsafe-inline'","img-src 'self' data: blob:","font-src 'self' data:","connect-src 'self' data: blob:","media-src 'self' data: blob:"].join("; "),PAGE_SOURCE="page";export class Pages{o;origins=new Map;constructor(n){this.o=n}async url(n,s,o){const r=await this.origin(s);r.pages.set(o,n);const d=r.port.url.endsWith("/")?r.port.url:`${r.port.url}/`,f=s===""?o:o.slice(s.length+1);return`${d}${f.split("/").map(encodeURIComponent).join("/")}`}origin(n){let s=this.origins.get(n);return s||(s=this.start(n),this.origins.set(n,s),s.catch(()=>{this.origins.get(n)===s&&this.origins.delete(n)})),s}async start(n){const{root:s,inputs:o}=this.o,r=new Map,d=new Map;let f=new Set;const m=i=>{let e;try{e=decodeURIComponent(i).replace(/^\/+/u,"")}catch{return}(e===""||e.endsWith("/"))&&(e=`${e}index.html`);const t=n===""?e:`${n}/${e}`;if($(t)===void 0&&!t.split("/").some(c=>c.startsWith(".")))return v.normalize(t)},w=(i,e)=>{const t=r.get(i);if(t!==void 0){o.set(t,PAGE_SOURCE,[i]);for(const a of d.values())a.delete(t);return new Set([t])}let c;try{const a=e===void 0?void 0:new URL(e);a&&f.has(a.host)&&(c=m(a.pathname))}catch{c=void 0}if(c!==void 0){const a=r.get(c);if(a!==void 0)return new Set([a]);const u=d.get(c);if(u)return new Set(u)}return new Set(r.values())},b=R(async i=>{const e=new URL(i.url),t=m(e.pathname);if(t===void 0)return new Response("not found",{status:404});const c=w(t,i.headers.get("referer")??void 0),a=d.get(t)??new Set;for(const g of c)a.add(g),o.add(g,PAGE_SOURCE,t);d.set(t,a);const u=U(s,t);return u?P(u,i.headers.get("range")??void 0,{"content-security-policy":PAGE_POLICY,"cache-control":"no-store","x-content-type-options":"nosniff"}):new Response("not found",{status:404})}),l=S((i,e)=>{if(!f.has(i.headers.host??"")){e.writeHead(403,{"content-type":"text/plain; charset=utf-8"}),e.end("forbidden host");return}b(i,e)});l.listen(0,"127.0.0.1"),await y(l,"listening");const p=l.address().port,h=x(this.o.ports,p);return f=new Set([`127.0.0.1:${String(p)}`,`localhost:${String(p)}`,...h.hosts,new URL(h.url).host]),{server:l,port:h,pages:r,loads:d}}async close(){const n=[...this.origins.values()];this.origins.clear();for(const s of n){const o=await s.catch(()=>{});o&&(o.port.dispose(),o.server.closeAllConnections(),await new Promise(r=>o.server.close(r)))}}}
@@ -0,0 +1,2 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ export function forwarded(e,d){const n=`http://127.0.0.1:${String(d)}/`;return e===void 0?{url:n,hosts:[],dispose:()=>{}}:(e.add(d),{url:e.public(n),hosts:e.hosts(d),dispose:()=>{e.remove(d)}})}