allyhub 0.9.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (461) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/commands/auth.js +4 -4
  3. package/dist/commands/cloud-tools.js +11 -11
  4. package/dist/commands/frames/compare.js +2 -2
  5. package/dist/commands/frames/piece.js +1 -1
  6. package/dist/commands/frames.js +8 -8
  7. package/dist/commands/index.js +1 -1
  8. package/dist/commands/inspect/common.js +4 -2
  9. package/dist/commands/inspect/facts.js +3 -3
  10. package/dist/commands/inspect/layout.js +1 -1
  11. package/dist/commands/orgs.js +2 -2
  12. package/dist/help.js +4 -4
  13. package/dist/main.js +8 -7
  14. package/dist/node_modules/@allyhub/3d-extension/package.json +34 -2
  15. package/dist/node_modules/@allyhub/audio/package.json +1 -1
  16. package/dist/node_modules/@allyhub/browser/package.json +1 -1
  17. package/dist/node_modules/@allyhub/build/package.json +1 -1
  18. package/dist/node_modules/@allyhub/canvas-extension/package.json +2 -1
  19. package/dist/node_modules/@allyhub/canvas-extension/skills/allyhub/references/canvas.md +4 -24
  20. package/dist/node_modules/@allyhub/canvas-model/package.json +1 -1
  21. package/dist/node_modules/@allyhub/chart/dist/chart-xml.js +2 -2
  22. package/dist/node_modules/@allyhub/chart/dist/chart.js +1 -1
  23. package/dist/node_modules/@allyhub/chart/package.json +1 -1
  24. package/dist/node_modules/@allyhub/check/package.json +1 -1
  25. package/dist/node_modules/@allyhub/cloud/dist/client.d.ts +10 -0
  26. package/dist/node_modules/@allyhub/cloud/dist/client.js +1 -1
  27. package/dist/node_modules/@allyhub/cloud/dist/config.d.ts +9 -0
  28. package/dist/node_modules/@allyhub/cloud/dist/config.js +1 -1
  29. package/dist/node_modules/@allyhub/cloud/dist/credentials.d.ts +4 -4
  30. package/dist/node_modules/@allyhub/cloud/dist/credentials.js +2 -2
  31. package/dist/node_modules/@allyhub/cloud/dist/device.d.ts +12 -0
  32. package/dist/node_modules/@allyhub/cloud/dist/device.js +2 -0
  33. package/dist/node_modules/@allyhub/cloud/package.json +1 -1
  34. package/dist/node_modules/@allyhub/components/package.json +1 -1
  35. package/dist/node_modules/@allyhub/components/r/callout.json +1 -1
  36. package/dist/node_modules/@allyhub/components/src/callout.ts +98 -13
  37. package/dist/node_modules/@allyhub/dev-server/package.json +1 -1
  38. package/dist/node_modules/@allyhub/diagnostics/package.json +1 -1
  39. package/dist/node_modules/@allyhub/doc/dist/captions.js +1 -1
  40. package/dist/node_modules/@allyhub/doc/dist/docx.js +4 -4
  41. package/dist/node_modules/@allyhub/doc/dist/html.js +50 -47
  42. package/dist/node_modules/@allyhub/doc/dist/model.js +1 -1
  43. package/dist/node_modules/@allyhub/doc/dist/page.js +1 -1
  44. package/dist/node_modules/@allyhub/doc/dist/paper.js +1 -1
  45. package/dist/node_modules/@allyhub/doc/dist/table.js +1 -1
  46. package/dist/node_modules/@allyhub/doc/dist/write.js +22 -22
  47. package/dist/node_modules/@allyhub/doc/package.json +1 -1
  48. package/dist/node_modules/@allyhub/doc-extension/dist/export.js +1 -1
  49. package/dist/node_modules/@allyhub/doc-extension/package.json +17 -2
  50. package/dist/node_modules/@allyhub/doc-print/package.json +1 -1
  51. package/dist/node_modules/@allyhub/export/dist/export.js +1 -1
  52. package/dist/node_modules/@allyhub/export/package.json +1 -1
  53. package/dist/node_modules/@allyhub/extension-api/package.json +1 -1
  54. package/dist/node_modules/@allyhub/extension-host/dist/points.js +1 -1
  55. package/dist/node_modules/@allyhub/extension-host/package.json +1 -1
  56. package/dist/node_modules/@allyhub/formats/dist/data/faces.d.ts +1 -1
  57. package/dist/node_modules/@allyhub/formats/dist/data/sheet.d.ts +87 -1
  58. package/dist/node_modules/@allyhub/formats/dist/data/sheet.js +1 -1
  59. package/dist/node_modules/@allyhub/formats/dist/data/slides.d.ts +89 -0
  60. package/dist/node_modules/@allyhub/formats/dist/data/slides.js +1 -1
  61. package/dist/node_modules/@allyhub/formats/dist/schemas.d.ts +50 -0
  62. package/dist/node_modules/@allyhub/formats/package.json +1 -1
  63. package/dist/node_modules/@allyhub/i18n/package.json +1 -1
  64. package/dist/node_modules/@allyhub/image-draw/package.json +1 -1
  65. package/dist/node_modules/@allyhub/image-extension/package.json +16 -1
  66. package/dist/node_modules/@allyhub/image-extension/skills/allyhub/references/images.md +7 -39
  67. package/dist/node_modules/@allyhub/image-measure/package.json +1 -1
  68. package/dist/node_modules/@allyhub/image-psd/package.json +1 -1
  69. package/dist/node_modules/@allyhub/image-render/package.json +1 -1
  70. package/dist/node_modules/@allyhub/image-runtime/package.json +1 -1
  71. package/dist/node_modules/@allyhub/image-sdk/package.json +1 -1
  72. package/dist/node_modules/@allyhub/jobs/package.json +1 -1
  73. package/dist/node_modules/@allyhub/measure/package.json +1 -1
  74. package/dist/node_modules/@allyhub/media/package.json +1 -1
  75. package/dist/node_modules/@allyhub/media-extension/dist/vision/faces.js +1 -1
  76. package/dist/node_modules/@allyhub/media-extension/package.json +7 -4
  77. package/dist/node_modules/@allyhub/model/package.json +1 -1
  78. package/dist/node_modules/@allyhub/ooxml/dist/geometry/index.js +1 -1
  79. package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
  80. package/dist/node_modules/@allyhub/piece/dist/layout.d.ts +16 -0
  81. package/dist/node_modules/@allyhub/piece/dist/page/locate.js +1 -1
  82. package/dist/node_modules/@allyhub/piece/dist/stage.d.ts +6 -0
  83. package/dist/node_modules/@allyhub/piece/package.json +1 -1
  84. package/dist/node_modules/@allyhub/project/dist/version.js +1 -1
  85. package/dist/node_modules/@allyhub/project/package.json +1 -1
  86. package/dist/node_modules/@allyhub/protocol/dist/account.d.ts +132 -0
  87. package/dist/node_modules/@allyhub/protocol/dist/account.js +1 -1
  88. package/dist/node_modules/@allyhub/protocol/dist/auth.d.ts +19 -1
  89. package/dist/node_modules/@allyhub/protocol/dist/auth.js +1 -1
  90. package/dist/node_modules/@allyhub/protocol/dist/browser-bridge.d.ts +337 -0
  91. package/dist/node_modules/@allyhub/protocol/dist/browser-bridge.js +2 -0
  92. package/dist/node_modules/@allyhub/protocol/dist/cloud.d.ts +153 -0
  93. package/dist/node_modules/@allyhub/protocol/dist/cloud.js +1 -1
  94. package/dist/node_modules/@allyhub/protocol/dist/editor.d.ts +4 -2
  95. package/dist/node_modules/@allyhub/protocol/dist/editor.js +1 -1
  96. package/dist/node_modules/@allyhub/protocol/dist/frame.d.ts +43 -188
  97. package/dist/node_modules/@allyhub/protocol/dist/frame.js +1 -1
  98. package/dist/node_modules/@allyhub/protocol/dist/index.d.ts +1 -0
  99. package/dist/node_modules/@allyhub/protocol/dist/index.js +1 -1
  100. package/dist/node_modules/@allyhub/protocol/dist/mail.d.ts +1 -0
  101. package/dist/node_modules/@allyhub/protocol/dist/mail.js +1 -1
  102. package/dist/node_modules/@allyhub/protocol/dist/notes.d.ts +51 -91
  103. package/dist/node_modules/@allyhub/protocol/dist/notes.js +1 -1
  104. package/dist/node_modules/@allyhub/protocol/dist/tools.d.ts +3 -3
  105. package/dist/node_modules/@allyhub/protocol/package.json +5 -1
  106. package/dist/node_modules/@allyhub/registry/package.json +1 -1
  107. package/dist/node_modules/@allyhub/render/dist/look.js +1 -1
  108. package/dist/node_modules/@allyhub/render/package.json +1 -1
  109. package/dist/node_modules/@allyhub/runtime/dist/compose.js +1 -1
  110. package/dist/node_modules/@allyhub/runtime/dist/embed.js +1 -1
  111. package/dist/node_modules/@allyhub/runtime/dist/player/clips.js +1 -1
  112. package/dist/node_modules/@allyhub/runtime/package.json +1 -1
  113. package/dist/node_modules/@allyhub/runtimes/package.json +1 -1
  114. package/dist/node_modules/@allyhub/scaffold/package.json +1 -1
  115. package/dist/node_modules/@allyhub/scenery/dist/index.d.ts +2 -2
  116. package/dist/node_modules/@allyhub/scenery/dist/index.js +1 -1
  117. package/dist/node_modules/@allyhub/scenery/dist/moire.d.ts +45 -5
  118. package/dist/node_modules/@allyhub/scenery/dist/moire.js +2 -2
  119. package/dist/node_modules/@allyhub/scenery/dist/phone.d.ts +4 -3
  120. package/dist/node_modules/@allyhub/scenery/dist/phone.js +1 -1
  121. package/dist/node_modules/@allyhub/scenery/package.json +1 -1
  122. package/dist/node_modules/@allyhub/scenery-host/dist/layer/grade.d.ts +7 -0
  123. package/dist/node_modules/@allyhub/scenery-host/dist/layer/grade.js +2 -0
  124. package/dist/node_modules/@allyhub/scenery-host/dist/layer/index.d.ts +4 -3
  125. package/dist/node_modules/@allyhub/scenery-host/dist/layer/index.js +1 -1
  126. package/dist/node_modules/@allyhub/scenery-host/dist/layer/screens.d.ts +1 -1
  127. package/dist/node_modules/@allyhub/scenery-host/dist/layer/screens.js +1 -1
  128. package/dist/node_modules/@allyhub/scenery-host/dist/measure/facts.js +1 -1
  129. package/dist/node_modules/@allyhub/scenery-host/dist/page/screens.d.ts +8 -0
  130. package/dist/node_modules/@allyhub/scenery-host/dist/page/screens.js +1 -1
  131. package/dist/node_modules/@allyhub/scenery-host/package.json +1 -1
  132. package/dist/node_modules/@allyhub/sheet/dist/calc/coerce.js +1 -1
  133. package/dist/node_modules/@allyhub/sheet/dist/calc/engine.js +1 -1
  134. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/criteria.js +1 -1
  135. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/date.js +1 -1
  136. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/define.js +1 -1
  137. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/info.js +1 -1
  138. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/kernels.js +1 -1
  139. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/lookup.js +1 -1
  140. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/maths.js +1 -1
  141. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/text.js +1 -1
  142. package/dist/node_modules/@allyhub/sheet/dist/calc/indexes.js +1 -1
  143. package/dist/node_modules/@allyhub/sheet/dist/calc/types.js +1 -1
  144. package/dist/node_modules/@allyhub/sheet/dist/chart.js +1 -1
  145. package/dist/node_modules/@allyhub/sheet/dist/formula/move.js +1 -1
  146. package/dist/node_modules/@allyhub/sheet/dist/formula/parse.js +1 -1
  147. package/dist/node_modules/@allyhub/sheet/dist/formula/print.js +1 -1
  148. package/dist/node_modules/@allyhub/sheet/dist/index.js +1 -1
  149. package/dist/node_modules/@allyhub/sheet/dist/inspect.js +1 -1
  150. package/dist/node_modules/@allyhub/sheet/dist/printed.js +2 -0
  151. package/dist/node_modules/@allyhub/sheet/dist/values.js +1 -1
  152. package/dist/node_modules/@allyhub/sheet/dist/workbook.js +1 -1
  153. package/dist/node_modules/@allyhub/sheet/dist/write.js +15 -15
  154. package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.js +1 -1
  155. package/dist/node_modules/@allyhub/sheet/dist/xlsx/formula.js +2 -2
  156. package/dist/node_modules/@allyhub/sheet/dist/xlsx/import.js +1 -1
  157. package/dist/node_modules/@allyhub/sheet/dist/xlsx/read.js +2 -2
  158. package/dist/node_modules/@allyhub/sheet/dist/xlsx/sax.js +3 -1
  159. package/dist/node_modules/@allyhub/sheet/dist/xlsx/styles.js +1 -1
  160. package/dist/node_modules/@allyhub/sheet/dist/xlsx/write.js +1 -1
  161. package/dist/node_modules/@allyhub/sheet/dist/xlsx/xml.js +3 -2
  162. package/dist/node_modules/@allyhub/sheet/package.json +1 -1
  163. package/dist/node_modules/@allyhub/sheet-extension/dist/export.js +4 -4
  164. package/dist/node_modules/@allyhub/sheet-extension/package.json +22 -3
  165. package/dist/node_modules/@allyhub/slides-core/dist/api.js +2 -2
  166. package/dist/node_modules/@allyhub/slides-core/dist/capabilities.js +1 -1
  167. package/dist/node_modules/@allyhub/slides-core/dist/enums.js +1 -1
  168. package/dist/node_modules/@allyhub/slides-core/dist/measure.js +1 -1
  169. package/dist/node_modules/@allyhub/slides-core/dist/resolve.js +1 -1
  170. package/dist/node_modules/@allyhub/slides-core/dist/sdk.js +1 -1
  171. package/dist/node_modules/@allyhub/slides-core/package.json +1 -1
  172. package/dist/node_modules/@allyhub/slides-extension/package.json +20 -1
  173. package/dist/node_modules/@allyhub/slides-pptx/dist/import/code.js +2 -2
  174. package/dist/node_modules/@allyhub/slides-pptx/dist/import/index.js +2 -2
  175. package/dist/node_modules/@allyhub/slides-pptx/dist/read/common.js +1 -1
  176. package/dist/node_modules/@allyhub/slides-pptx/dist/read/shapes.js +1 -1
  177. package/dist/node_modules/@allyhub/slides-pptx/dist/read/text.js +1 -1
  178. package/dist/node_modules/@allyhub/slides-pptx/dist/shapes.js +1 -1
  179. package/dist/node_modules/@allyhub/slides-pptx/dist/text.js +1 -1
  180. package/dist/node_modules/@allyhub/slides-pptx/dist/write.js +2 -2
  181. package/dist/node_modules/@allyhub/slides-pptx/dist/xml.js +1 -1
  182. package/dist/node_modules/@allyhub/slides-pptx/package.json +1 -1
  183. package/dist/node_modules/@allyhub/slides-runtime/dist/draw.js +2 -2
  184. package/dist/node_modules/@allyhub/slides-runtime/dist/load.js +5 -5
  185. package/dist/node_modules/@allyhub/slides-runtime/package.json +1 -1
  186. package/dist/node_modules/@allyhub/stage/package.json +1 -1
  187. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/400-italic.css +19 -0
  188. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/400.css +19 -0
  189. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/700-italic.css +19 -0
  190. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/700.css +19 -0
  191. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/LICENSE +93 -0
  192. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/cambria.css +76 -0
  193. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-400-italic.woff2 +0 -0
  194. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-400-normal.woff2 +0 -0
  195. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-700-italic.woff2 +0 -0
  196. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-700-normal.woff2 +0 -0
  197. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-ext-400-italic.woff2 +0 -0
  198. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-ext-400-normal.woff2 +0 -0
  199. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-ext-700-italic.woff2 +0 -0
  200. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-ext-700-normal.woff2 +0 -0
  201. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/400-italic.css +79 -0
  202. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/400.css +79 -0
  203. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/700-italic.css +79 -0
  204. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/700.css +79 -0
  205. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/LICENSE +93 -0
  206. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/courier-new.css +316 -0
  207. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-400-italic.woff2 +0 -0
  208. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-400-normal.woff2 +0 -0
  209. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-700-italic.woff2 +0 -0
  210. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-700-normal.woff2 +0 -0
  211. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-ext-400-italic.woff2 +0 -0
  212. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-ext-400-normal.woff2 +0 -0
  213. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-ext-700-italic.woff2 +0 -0
  214. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-ext-700-normal.woff2 +0 -0
  215. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-400-italic.woff2 +0 -0
  216. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-400-normal.woff2 +0 -0
  217. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-700-italic.woff2 +0 -0
  218. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-700-normal.woff2 +0 -0
  219. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-ext-400-italic.woff2 +0 -0
  220. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-ext-400-normal.woff2 +0 -0
  221. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-ext-700-italic.woff2 +0 -0
  222. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-ext-700-normal.woff2 +0 -0
  223. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-hebrew-400-italic.woff2 +0 -0
  224. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-hebrew-400-normal.woff2 +0 -0
  225. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-hebrew-700-italic.woff2 +0 -0
  226. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-hebrew-700-normal.woff2 +0 -0
  227. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-400-italic.woff2 +0 -0
  228. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-400-normal.woff2 +0 -0
  229. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-700-italic.woff2 +0 -0
  230. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-700-normal.woff2 +0 -0
  231. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-ext-400-italic.woff2 +0 -0
  232. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-ext-400-normal.woff2 +0 -0
  233. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-ext-700-italic.woff2 +0 -0
  234. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-ext-700-normal.woff2 +0 -0
  235. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-vietnamese-400-italic.woff2 +0 -0
  236. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-vietnamese-400-normal.woff2 +0 -0
  237. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-vietnamese-700-italic.woff2 +0 -0
  238. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-vietnamese-700-normal.woff2 +0 -0
  239. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/400-italic.css +79 -0
  240. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/400.css +79 -0
  241. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/700-italic.css +79 -0
  242. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/700.css +79 -0
  243. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/LICENSE +93 -0
  244. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-400-italic.woff2 +0 -0
  245. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-400-normal.woff2 +0 -0
  246. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-700-italic.woff2 +0 -0
  247. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-700-normal.woff2 +0 -0
  248. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-ext-400-italic.woff2 +0 -0
  249. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-ext-400-normal.woff2 +0 -0
  250. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-ext-700-italic.woff2 +0 -0
  251. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-ext-700-normal.woff2 +0 -0
  252. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-400-italic.woff2 +0 -0
  253. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-400-normal.woff2 +0 -0
  254. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-700-italic.woff2 +0 -0
  255. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-700-normal.woff2 +0 -0
  256. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-ext-400-italic.woff2 +0 -0
  257. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-ext-400-normal.woff2 +0 -0
  258. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-ext-700-italic.woff2 +0 -0
  259. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-ext-700-normal.woff2 +0 -0
  260. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-hebrew-400-italic.woff2 +0 -0
  261. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-hebrew-400-normal.woff2 +0 -0
  262. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-hebrew-700-italic.woff2 +0 -0
  263. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-hebrew-700-normal.woff2 +0 -0
  264. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-400-italic.woff2 +0 -0
  265. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-400-normal.woff2 +0 -0
  266. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-700-italic.woff2 +0 -0
  267. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-700-normal.woff2 +0 -0
  268. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-ext-400-italic.woff2 +0 -0
  269. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-ext-400-normal.woff2 +0 -0
  270. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-ext-700-italic.woff2 +0 -0
  271. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-ext-700-normal.woff2 +0 -0
  272. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-vietnamese-400-italic.woff2 +0 -0
  273. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-vietnamese-400-normal.woff2 +0 -0
  274. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-vietnamese-700-italic.woff2 +0 -0
  275. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-vietnamese-700-normal.woff2 +0 -0
  276. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/times-new-roman.css +316 -0
  277. package/dist/node_modules/@allyhub/stage-page/dist/host.js +1 -1
  278. package/dist/node_modules/@allyhub/stage-page/dist/runtime/stage.html +3 -0
  279. package/dist/node_modules/@allyhub/stage-page/package.json +1 -1
  280. package/dist/node_modules/@allyhub/stage-runtime/dist/runtime.js +19 -19
  281. package/dist/node_modules/@allyhub/stage-runtime/package.json +1 -1
  282. package/dist/node_modules/@allyhub/video-core/dist/schema.js +1 -1
  283. package/dist/node_modules/@allyhub/video-core/package.json +1 -1
  284. package/dist/node_modules/@allyhub/video-extension/package.json +16 -1
  285. package/dist/node_modules/@allyhub/video-measure/dist/version.js +1 -1
  286. package/dist/node_modules/@allyhub/video-measure/package.json +1 -1
  287. package/dist/node_modules/@allyhub/video-sdk/dist/phone.js +1 -1
  288. package/dist/node_modules/@allyhub/video-sdk/package.json +1 -1
  289. package/dist/node_modules/@allyhub/website/package.json +1 -1
  290. package/dist/node_modules/@allyhub/website-extension/dist/held.js +2 -0
  291. package/dist/node_modules/@allyhub/website-extension/dist/project-tools.js +24 -1
  292. package/dist/node_modules/@allyhub/website-extension/dist/tools.js +1 -1
  293. package/dist/node_modules/@allyhub/website-extension/package.json +49 -2
  294. package/dist/node_modules/@allyhub/x-extension/package.json +34 -4
  295. package/dist/node_modules/@allyhub/x-extension/skills/allyhub/references/x.md +7 -62
  296. package/dist/node_modules/@allyhub/x-model/package.json +1 -1
  297. package/dist/node_modules/@allyhub/x-view/dist/article.js +1 -1
  298. package/dist/node_modules/@allyhub/x-view/dist/index.js +1 -1
  299. package/dist/node_modules/@allyhub/x-view/dist/post.js +2 -2
  300. package/dist/node_modules/@allyhub/x-view/package.json +1 -1
  301. package/dist/package.json +10 -10
  302. package/dist/text/facts-text.js +5 -5
  303. package/dist/text/index.js +1 -1
  304. package/dist/text/long-text.js +4 -0
  305. package/dist/works.js +1 -1
  306. package/editor-web/assets/{abnfDiagram-WEYOIA3C-CN5PiJYY.js → abnfDiagram-WEYOIA3C-CjAmWsNR.js} +1 -1
  307. package/editor-web/assets/alt-DnBZJzEh.js +4 -0
  308. package/editor-web/assets/{architecture-WOLXFQ4H-BnvZtQYk.js → architecture-WOLXFQ4H-DeeKhyhZ.js} +1 -1
  309. package/editor-web/assets/{architectureDiagram-ZHVYKT53-tkcEcFQ8.js → architectureDiagram-ZHVYKT53-b32qTaJg.js} +1 -1
  310. package/editor-web/assets/{arrow-up-DTP2yVSU.js → arrow-up-L4YV_65f.js} +1 -1
  311. package/editor-web/assets/article-DLMjAdbP.js +73 -0
  312. package/editor-web/assets/{audio-lines-Ti8-m7H2.js → audio-lines-BFcM7G2L.js} +1 -1
  313. package/editor-web/assets/{blockDiagram-RJAE7QA3-DhqEIpie.js → blockDiagram-RJAE7QA3-BNbnMNmw.js} +1 -1
  314. package/editor-web/assets/button-Chk675Xu.js +41 -0
  315. package/editor-web/assets/{c4Diagram-XDPPPE54-Bg9G95tl.js → c4Diagram-XDPPPE54-BEuemvMw.js} +1 -1
  316. package/editor-web/assets/calc-worker-D2pGis6e.js +45 -0
  317. package/editor-web/assets/channel-EzYq4r0d.js +1 -0
  318. package/editor-web/assets/chart-Be9Hj5GL.js +1 -0
  319. package/editor-web/assets/choice-BgmBh4yu.js +1 -0
  320. package/editor-web/assets/{chunk-2E7WHVMD-C8Ve9lAa.js → chunk-2E7WHVMD-Zb5nPx_e.js} +1 -1
  321. package/editor-web/assets/{chunk-4EMNKR2T-BDWwPUnT.js → chunk-4EMNKR2T-DSEM2reX.js} +1 -1
  322. package/editor-web/assets/{chunk-55XCU76K-BQiNPKgx.js → chunk-55XCU76K-BOZa_65H.js} +1 -1
  323. package/editor-web/assets/{chunk-7S6XSTFO-QoEt-6jf.js → chunk-7S6XSTFO-DeiGeVpB.js} +1 -1
  324. package/editor-web/assets/{chunk-AQDTSKZB-BeuwIv0-.js → chunk-AQDTSKZB-fPuQFBJc.js} +1 -1
  325. package/editor-web/assets/{chunk-DSNLSHJZ-BHW7sLAz.js → chunk-DSNLSHJZ-5vdnoak2.js} +1 -1
  326. package/editor-web/assets/{chunk-HAGFOTED-bbGED0hu.js → chunk-HAGFOTED-DFF2mZJ1.js} +1 -1
  327. package/editor-web/assets/{chunk-HNE4Q36P-FltWp8yo.js → chunk-HNE4Q36P-g6-ZLbTg.js} +1 -1
  328. package/editor-web/assets/{chunk-NQOKRVIF-NeQzr6kH.js → chunk-NQOKRVIF-o3hNcHMJ.js} +1 -1
  329. package/editor-web/assets/{chunk-UHW7PFBP-eA4-WUhn.js → chunk-UHW7PFBP-BQiDI9dK.js} +1 -1
  330. package/editor-web/assets/{chunk-VQ5W62QI-BPPv325z.js → chunk-VQ5W62QI-CJlMXWWz.js} +1 -1
  331. package/editor-web/assets/{chunk-WQQL4CDK-DOCIz7Te.js → chunk-WQQL4CDK-pNBU8dXv.js} +1 -1
  332. package/editor-web/assets/{chunk-YZO67HFG-Dc_ihQJi.js → chunk-YZO67HFG-2x-BiWd-.js} +1 -1
  333. package/editor-web/assets/{chunk-ZAUX2LTX-CoqwCPSm.js → chunk-ZAUX2LTX-etFStEM8.js} +1 -1
  334. package/editor-web/assets/{chunk-ZCHMQSOR-CZUQPkJx.js → chunk-ZCHMQSOR-B3AYRhIY.js} +1 -1
  335. package/editor-web/assets/{classDiagram-v2-4MYWR3UA-DUh9c50k.js → classDiagram-v2-4MYWR3UA-6y2yX0oq.js} +1 -1
  336. package/editor-web/assets/collaborator-LRd0hELn.js +1 -0
  337. package/editor-web/assets/createLucideIcon-CPS-TrJJ.js +1 -0
  338. package/editor-web/assets/{cynefin-EF2NZ3EQ-DUTZiog0.js → cynefin-EF2NZ3EQ-CX4BTQQe.js} +1 -1
  339. package/editor-web/assets/{cynefinDiagram-WF24UDRP-oAjpfbrU.js → cynefinDiagram-WF24UDRP-LbDkOTy3.js} +1 -1
  340. package/editor-web/assets/{dagre-NK4GIZVX-BrKvKCvb.js → dagre-NK4GIZVX-wCKQk7hi.js} +1 -1
  341. package/editor-web/assets/{diagram-CBK3MWTC-GekVRnmm.js → diagram-CBK3MWTC-a9fofQwk.js} +1 -1
  342. package/editor-web/assets/{diagram-I5XIIV2D-CDd1VFRT.js → diagram-I5XIIV2D-UCLZWch5.js} +1 -1
  343. package/editor-web/assets/{diagram-ODIL2UCW-535RISTn.js → diagram-ODIL2UCW-CAEe88Lp.js} +1 -1
  344. package/editor-web/assets/{diagram-PFBEJUXE-MXzzKCGG.js → diagram-PFBEJUXE-Cp1o45bs.js} +1 -1
  345. package/editor-web/assets/{diagram-RJA3I4VV-vKVwkQxY.js → diagram-RJA3I4VV-c6OVxDyq.js} +1 -1
  346. package/editor-web/assets/{diagram-TYUNFSNR-UwGAiQLx.js → diagram-TYUNFSNR-BVRWslDM.js} +1 -1
  347. package/editor-web/assets/{dist-CKyfo5RM.js → dist--KKyT5zP.js} +1 -1
  348. package/editor-web/assets/dist-1k0MHB3i.js +1 -0
  349. package/editor-web/assets/dist-B9KHJqL5.js +4 -0
  350. package/editor-web/assets/dist-BbJyrhIY.js +1 -0
  351. package/editor-web/assets/dist-CJXCQxQM.js +37 -0
  352. package/editor-web/assets/dist-D9xQGwe9.js +5 -0
  353. package/editor-web/assets/dist-DFiLzbx8.js +219 -0
  354. package/editor-web/assets/{dist-shKo7XVN.js → dist-DIPV6xfF.js} +1 -1
  355. package/editor-web/assets/dist-Dp-fQMtx.js +6 -0
  356. package/editor-web/assets/dist-Duw28VxJ.js +16 -0
  357. package/editor-web/assets/{dist-9ymlIMhr.js → dist-DwGhfliS.js} +1 -1
  358. package/editor-web/assets/dist-OBE2IIYP.js +24 -0
  359. package/editor-web/assets/dist-j6ZLVcgf.js +38 -0
  360. package/editor-web/assets/{ebnfDiagram-V4P3TTPT-73yGokYa.js → ebnfDiagram-V4P3TTPT-KdOTJgFu.js} +1 -1
  361. package/editor-web/assets/{elk-QONTBCTQ-BW6V9y6a.js → elk-QONTBCTQ-Cmlrp7qB.js} +1 -1
  362. package/editor-web/assets/{erDiagram-KYQIGQAA-BPqIJ22h.js → erDiagram-KYQIGQAA-CBM7-aQm.js} +1 -1
  363. package/editor-web/assets/{eventmodeling-K75KTNOO-_VZ8jvuy.js → eventmodeling-K75KTNOO-CEoJkbuW.js} +1 -1
  364. package/editor-web/assets/flowDiagram-IUGLLWBU-Xm2E2ib_.js +1 -0
  365. package/editor-web/assets/{ganttDiagram-R7GPNTJY-DZ157JN2.js → ganttDiagram-R7GPNTJY-D4S6ZSYD.js} +1 -1
  366. package/editor-web/assets/{gitGraph-VSP46ZUC-fmcNL9bq.js → gitGraph-VSP46ZUC-BvkL6RSh.js} +1 -1
  367. package/editor-web/assets/{gitGraphDiagram-PDYL7XHY-DiZDyksR.js → gitGraphDiagram-PDYL7XHY-lTGguloH.js} +1 -1
  368. package/editor-web/assets/hint-BimUgJms.js +1 -0
  369. package/editor-web/assets/index-C-i_iuxN.js +28 -0
  370. package/editor-web/assets/index-Cxh_Shkm.css +2 -0
  371. package/editor-web/assets/{info-OHQRW6UA-V06620kN.js → info-OHQRW6UA-DvKzqNvp.js} +1 -1
  372. package/editor-web/assets/{infoDiagram-MVDRKAX5-CbIgheWX.js → infoDiagram-MVDRKAX5-D7hCpehs.js} +1 -1
  373. package/editor-web/assets/{ishikawaDiagram-HPEHV2GE-D5oJQPkG.js → ishikawaDiagram-HPEHV2GE-Bg93sZQe.js} +1 -1
  374. package/editor-web/assets/{italic-CDhZKo_q.js → italic-BQBwRTe8.js} +1 -1
  375. package/editor-web/assets/{journeyDiagram-BOSHW7O7-BZEv6JI4.js → journeyDiagram-BOSHW7O7-CKm_KONJ.js} +1 -1
  376. package/editor-web/assets/{kanban-definition-FNSA4HC5-CLG1R8y_.js → kanban-definition-FNSA4HC5-BKknnpTR.js} +1 -1
  377. package/editor-web/assets/{mermaid-parser.core-DxDwXM7z.js → mermaid-parser.core-BzqkDnqL.js} +3 -3
  378. package/editor-web/assets/{mermaid.core-tU55ZwVG.js → mermaid.core-CEpvTOAe.js} +4 -4
  379. package/editor-web/assets/{mindmap-definition-6OY57UG3-CYf4zzAh.js → mindmap-definition-6OY57UG3-BJ0qG8Wi.js} +1 -1
  380. package/editor-web/assets/minus-oPj1GxwA.js +1 -0
  381. package/editor-web/assets/{packet-JDAUHWVQ-DsHeKYNL.js → packet-JDAUHWVQ-ew3kvyFm.js} +1 -1
  382. package/editor-web/assets/{pegDiagram-ECIUJNBX-CQyh6TTa.js → pegDiagram-ECIUJNBX-DqUS2xit.js} +1 -1
  383. package/editor-web/assets/{pie-XZMESJXO-3vCIvpNB.js → pie-XZMESJXO-DTIAMPGm.js} +1 -1
  384. package/editor-web/assets/{pieDiagram-GNMPY74T-DF5yGBLn.js → pieDiagram-GNMPY74T-DoKOE02-.js} +1 -1
  385. package/editor-web/assets/progress-CPEbDOoN.js +6 -0
  386. package/editor-web/assets/{quadrantDiagram-D57K4MC3-B7pxlDYP.js → quadrantDiagram-D57K4MC3-DauOpYun.js} +1 -1
  387. package/editor-web/assets/{radar-ABXABTNO-cpEA41mL.js → radar-ABXABTNO-BvMJXUU-.js} +1 -1
  388. package/editor-web/assets/{railroad-I3PHUGI6-BLyy5R2c.js → railroad-I3PHUGI6-D3jdJmhM.js} +1 -1
  389. package/editor-web/assets/{railroad-abnf-LNEFI6M7-Y-oyol19.js → railroad-abnf-LNEFI6M7-Dm8ZpmPj.js} +1 -1
  390. package/editor-web/assets/{railroad-ebnf-DWYD2UWJ-o58wHZsr.js → railroad-ebnf-DWYD2UWJ-oc0Du7Ag.js} +1 -1
  391. package/editor-web/assets/{railroad-peg-JR7BVNR7-CcD3PXZ8.js → railroad-peg-JR7BVNR7-CMrQL_7U.js} +1 -1
  392. package/editor-web/assets/{railroadDiagram-Y72NRBL7-BuCC4eyy.js → railroadDiagram-Y72NRBL7-y99z0C7i.js} +1 -1
  393. package/editor-web/assets/react-DztDSW4P.js +1 -0
  394. package/editor-web/assets/{repeat-2-C5PCbNsg.js → repeat-2-DJi4LW5C.js} +1 -1
  395. package/editor-web/assets/{requirementDiagram-EQYSW5RA-Dp-JFGn4.js → requirementDiagram-EQYSW5RA-jMr_uoF6.js} +1 -1
  396. package/editor-web/assets/row-ClBisiBs.js +1 -0
  397. package/editor-web/assets/{sankeyDiagram-SY24JHO5-rYuCqEvw.js → sankeyDiagram-SY24JHO5-DcUyx03Q.js} +1 -1
  398. package/editor-web/assets/schemas-68mjUjP5.js +1 -0
  399. package/editor-web/assets/{sequenceDiagram-BLEHNHQU-DryW8x6d.js → sequenceDiagram-BLEHNHQU-R4X8wRCd.js} +1 -1
  400. package/editor-web/assets/session-2u9U7koW.js +1 -0
  401. package/editor-web/assets/slides-BByblSSR.js +1 -0
  402. package/editor-web/assets/snapshots-C9KV-Y2_.js +56 -0
  403. package/editor-web/assets/sound-DExlNJbb.js +1 -0
  404. package/editor-web/assets/{stateDiagram-v2-A6IESKWZ-Bnp0XfpT.js → stateDiagram-v2-A6IESKWZ-BqvXKbCA.js} +1 -1
  405. package/editor-web/assets/{strikethrough-DJckA35o.js → strikethrough-CyUBnGTl.js} +1 -1
  406. package/editor-web/assets/{svg-BjM9RazX.js → svg-lBRT-uhy.js} +1 -1
  407. package/editor-web/assets/swatch-1c1uVn1z.js +1 -0
  408. package/editor-web/assets/{swimlanes-B3ENRKFQ-BiRRhhbd.js → swimlanes-B3ENRKFQ-hjTXIc6M.js} +1 -1
  409. package/editor-web/assets/swimlanesDiagram-AYQRV4AK-BLfytmPY.js +8 -0
  410. package/editor-web/assets/switch-D0K-K8-C.js +1 -0
  411. package/editor-web/assets/{syntax-CC6QYhCz.js → syntax-Bih_jv7W.js} +1 -1
  412. package/editor-web/assets/tabs-CxxOnGLR.js +1 -0
  413. package/editor-web/assets/{textarea-BGtPqZdB.js → textarea-Fu93tFO3.js} +1 -1
  414. package/editor-web/assets/{timeline-definition-JXYKGLGB-D-Q5ZtDF.js → timeline-definition-JXYKGLGB-BcSoN4Dq.js} +1 -1
  415. package/editor-web/assets/{trash-2-Bjj6cWzP.js → trash-2-BAKAeziW.js} +1 -1
  416. package/editor-web/assets/{treeView-D4JQ5SDB-B6DDatXq.js → treeView-D4JQ5SDB-CsFN2jrc.js} +1 -1
  417. package/editor-web/assets/{treemap-SAJKECNS-D7j5ZhiI.js → treemap-SAJKECNS-DP1eqXJ2.js} +1 -1
  418. package/editor-web/assets/{undo-2-yOSG766T.js → undo-2-DQ5CBmki.js} +1 -1
  419. package/editor-web/assets/{usecaseDiagram-WPOLBNNX-tkrdKUJB.js → usecaseDiagram-WPOLBNNX-BGxa0osF.js} +1 -1
  420. package/editor-web/assets/{vennDiagram-Q3Y3IDCW-Ch4XbSnD.js → vennDiagram-Q3Y3IDCW-D2XhTF49.js} +1 -1
  421. package/editor-web/assets/video-CDbPX4Cr.js +1 -0
  422. package/editor-web/assets/{wardley-7MLQ67FV-Bynt7qNQ.js → wardley-7MLQ67FV-DM3jMAbZ.js} +1 -1
  423. package/editor-web/assets/{wardleyDiagram-IVAIDKWA-DRuSgm_L.js → wardleyDiagram-IVAIDKWA-Bf-DaZEg.js} +1 -1
  424. package/editor-web/assets/{xychartDiagram-4URNHDU4-DctpvfkL.js → xychartDiagram-4URNHDU4-dp-mdcWd.js} +1 -1
  425. package/editor-web/index.html +6 -5
  426. package/package.json +2 -2
  427. package/editor-web/assets/alt-BOVao_9S.js +0 -4
  428. package/editor-web/assets/article-B6YCzhj8.js +0 -73
  429. package/editor-web/assets/calc-worker-B5-fDWnb.js +0 -45
  430. package/editor-web/assets/channel-C26aBI4o.js +0 -1
  431. package/editor-web/assets/chart-BOnxneyw.js +0 -1
  432. package/editor-web/assets/choice-O5nwc2N0.js +0 -1
  433. package/editor-web/assets/collaborator-BJU5qwHd.js +0 -1
  434. package/editor-web/assets/createLucideIcon-B3B95oX5.js +0 -1
  435. package/editor-web/assets/dist-C6NqUEG4.js +0 -16
  436. package/editor-web/assets/dist-C9UGmCG9.js +0 -6
  437. package/editor-web/assets/dist-CAk5bjBm.js +0 -1
  438. package/editor-web/assets/dist-CRaWqNwq.js +0 -37
  439. package/editor-web/assets/dist-CwIBc7HQ.js +0 -1
  440. package/editor-web/assets/dist-DXRmkezB.js +0 -38
  441. package/editor-web/assets/dist-EKK5i0dG.js +0 -219
  442. package/editor-web/assets/dist-hHJlpLWo.js +0 -5
  443. package/editor-web/assets/dist-oYKcwWUj.js +0 -4
  444. package/editor-web/assets/dist-wrKxBrVu.js +0 -24
  445. package/editor-web/assets/flowDiagram-IUGLLWBU-ouDQYiTr.js +0 -1
  446. package/editor-web/assets/hint-_AQWCDMj.js +0 -1
  447. package/editor-web/assets/index-BsstP-cI.js +0 -28
  448. package/editor-web/assets/index-DQRcmxBO.css +0 -2
  449. package/editor-web/assets/minus-Cgmm6ncD.js +0 -1
  450. package/editor-web/assets/progress-0B_TVsPi.js +0 -6
  451. package/editor-web/assets/react-BP46yLMB.js +0 -1
  452. package/editor-web/assets/react-pgBZqVxJ.js +0 -96
  453. package/editor-web/assets/schemas-Ewwjtbf4.js +0 -1
  454. package/editor-web/assets/session-DiI9KYRI.js +0 -1
  455. package/editor-web/assets/slides-CCwgBcGH.js +0 -1
  456. package/editor-web/assets/sound-CqryteNl.js +0 -1
  457. package/editor-web/assets/swatch-DL3HqIjW.js +0 -1
  458. package/editor-web/assets/swimlanesDiagram-AYQRV4AK-BkOls8Tv.js +0 -8
  459. package/editor-web/assets/switch-DltnKqN-.js +0 -1
  460. package/editor-web/assets/tabs-C-re0Kxn.js +0 -1
  461. package/editor-web/assets/video-DXFiCNGc.js +0 -1
@@ -1,13 +1,13 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{chartColor as Y,chartFrame as Q,docChartSvg as V}from"./chart.js";import{BACKGROUNDS as L,TEXT_COLORS as W}from"./color.js";import{columnWidths as ee,COLUMN_GAP as te}from"./columns.js";import{COMPONENT_WIDTH as G,componentName as ne}from"./component.js";import{citationText as ie,citedOf as oe,sourceList as ae}from"./cite.js";import{blockId as se,captionNumbers as re,contentsTitle as de,numberedCaption as M,writtenInChinese as le}from"./captions.js";import{DRAWN_CODE as B,mathHtml as ce}from"./math.js";import{columnShares as pe,numberColumns as fe}from"./table.js";import{splitTitle as he}from"./title.js";import{PAPER as p,TONE_COLORS as D,tagColors as ge}from"./paper.js";import{COVER_HEIGHT_MM as ue,everyBlock as A,innerBlocks as me,noteNumbers as $e,statTone as be}from"./model.js";import{effectiveLook as R,lineMultiple as xe,resolvePage as q,SINGLE_LINE as I}from"./page.js";export const PAGE_FACES={sans:'Carlito, Calibri, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif',serif:'Caladea, Cambria, "Noto Serif SC", "Songti SC", Georgia, serif',times:'Tinos, "Times New Roman", Times, "Noto Serif SC", serif',mono:'Cousine, "Courier New", "Noto Sans SC", monospace',song:'"Noto Serif SC", "Songti SC", SimSun, "宋体", serif',hei:'"Noto Sans SC", "PingFang SC", SimHei, "黑体", sans-serif',fangsong:'FangSong, STFangsong, "仿宋", "FangSong_GB2312", "Noto Serif SC", serif',kai:'"LXGW WenKai", KaiTi, STKaiti, "楷体", "Noto Serif SC", serif',xiaobiaosong:'"FZXiaoBiaoSong-B05S", "方正小标宋简体", "Noto Serif SC", "Songti SC", serif'};export function pageFaces(i={}){const t=R(i).font??"sans";return{text:PAGE_FACES[t],heading:PAGE_FACES[t],mono:PAGE_FACES.mono}}export const pageAccent=(i={})=>i.accent===void 0?void 0:Y(i.accent);export{BACKGROUNDS,TEXT_COLORS}from"./color.js";export function blockNumbers(i){const t=new Map;for(const e of A(i))t.set(e,t.size);return t}const c=i=>i.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),_=(i,t)=>t[i]??(/^(#[0-9a-f]{3,8}|[a-z]+|(rgb|hsl)a?\([\d\s.,%/]+\))$/i.test(i)?i:void 0),g=(i,t)=>{const e=t.ids?.get(i);return e===void 0?"":` data-b="${String(e)}"`};export function headingAnchors(i){const t=new Map,e=new Map;for(const a of A(i)){if(a.type!=="heading")continue;const s=a.content.map(r=>r.text).join("").trim().toLowerCase().replace(/[^\p{L}\p{N}\s-]/gu,"").replace(/\s/gu,"-"),n=s===""?"section":s,o=e.get(n)??0;e.set(n,o+1),t.set(a,o===0?n:`${n}-${String(o)}`)}return t}function k(i,t){return i.map(e=>{if(e.cite!==void 0){const{items:d,numbers:l,style:f}=t.sources,u=oe(e.cite).keys[0],S=c(ie(e.cite,d,l,f));return u!==void 0&&l.has(u)?`<a class="cite" href="#source-${c(u)}">${S}</a>`:`<span class="cite">${S}</span>`}if(e.note!==void 0){const d=t.notes.get(e.note.toLowerCase());return d===void 0?`<sup class="fn">[${c(e.note)}]</sup>`:`<sup class="fn"><a href="#note-${String(d)}">${String(d)}</a></sup>`}const a=e.text===""&&e.href?.startsWith("#")===!0?t.refs.get(decodeURIComponent(e.href.slice(1)))??"":e.text;let s=c(a).replace(/\n/g,"<br>");const n=e.styles;n.code&&(s=`<code>${s}</code>`),n.strike&&(s=`<s>${s}</s>`),n.italic&&(s=`<em>${s}</em>`),n.bold&&(s=`<strong>${s}</strong>`),n.underline&&(s=`<u>${s}</u>`);const o=n.color===void 0?void 0:_(n.color,W),r=n.background===void 0?void 0:_(n.background,L);if((o!==void 0||r!==void 0)&&(s=`<span style="${o===void 0?"":`color:${o};`}${r===void 0?"":`background:${r};`}">${s}</span>`),n.tag!==void 0){const d=ge(n.tag);s=`<span class="tag" style="background:${d.bg};color:${d.fg}">${s}</span>`}return e.href!==void 0&&/^(https?:|mailto:|#|\/|\.)/i.test(e.href)&&(s=`<a href="${c(e.href)}">${s}</a>`),s}).join("")}function C(i){if(!i)return"";const t=i.color===void 0?void 0:_(i.color,W),e=i.background===void 0?void 0:_(i.background,L),a=[i.align===void 0?"":`text-align:${i.align};`,t===void 0?"":`color:${t};`,e===void 0?"":`background:${e};padding:0.15em 0.4em;border-radius:3px;`].join("");return a===""?"":` style="${a}"`}const U=i=>i.type==="bullet"||i.type==="numbered"||i.type==="check";function y(i,t,e){const a=[];let s=0;for(;s<i.length;){const n=i[s];if(n===void 0)break;if(U(n)){const o=n.type==="numbered";let r=s;const d=[];for(;r<i.length;){const f=i[r];if(!f||!U(f)||f.type==="numbered"!==o)break;const u=f.type==="check"?`<span class="box${f.checked?" done":""}"></span>`:"";d.push(`<li${g(f,e)}${f.type==="check"?` class="task${f.checked?" done":""}"`:""}${C(f.look)}>${u}<span class="words">${k(f.content,e)}</span>${y(f.children??[],t,e)}</li>`),r++}const l=n.type==="numbered"&&n.start!==void 0?` start="${String(n.start)}"`:"";a.push(o?`<ol${l}>${d.join("")}</ol>`:`<ul>${d.join("")}</ul>`),s=r;continue}switch(s++,n.type){case"paragraph":a.push(`<p${g(n,e)}${C(n.look)}>${k(n.content,e)||"&nbsp;"}</p>${O(n.children,t,e)}`);break;case"heading":{const o=`h${String(n.level)}`;a.push(`<${o} id="${c(e.anchors.get(n)??"")}"${g(n,e)}${C(n.look)}>${k(n.content,e)}</${o}>${O(n.children,t,e)}`);break}case"toggle":a.push(`<p${g(n,e)}${C(n.look)}>${k(n.content,e)}</p>${O(n.children,t,e)}`);break;case"quote":a.push(`<blockquote${g(n,e)}${C(n.look)}><p>${k(n.content,e)}</p>${y(n.children??[],t,e)}</blockquote>`);break;case"callout":a.push(`<div class="callout"${g(n,e)}${C(n.look)}><span class="callout-icon">${c(n.icon??"💡")}</span><div><p>${k(n.content,e)}</p>${y(n.children??[],t,e)}</div></div>`);break;case"card":a.push(`<div class="card${cardKept(n,q(t.page))?" kept":""}"${g(n,e)}>${n.title===void 0&&n.subtitle===void 0?"":`<div class="card-head">${n.title===void 0?"":`<p class="card-title">${c(n.title)}</p>`}${n.subtitle===void 0?"":`<p class="card-subtitle">${c(n.subtitle)}</p>`}</div>`}${y(n.children??[],{...t,room:(t.room??G)-2*ye},e)}</div>`);break;case"stats":a.push(`<div class="stats"${g(n,e)} style="grid-template-columns:repeat(${String(n.stats.length)},minmax(0,1fr))">${n.stats.map(o=>{const r=be(o),d=o.delta===void 0&&o.note===void 0?"":`<p class="stat-foot">${o.delta===void 0?"":`<span class="stat-delta" style="color:${D[r]}">${c(o.delta)}</span>`}${o.delta!==void 0&&o.note!==void 0?" ":""}${o.note===void 0?"":c(o.note)}</p>`,l=o.trend===void 0?"":trendSvg(o.trend,D[r==="flat"?"flat":r]);return`<div class="stat"><p class="stat-label">${c(o.label)}</p><p class="stat-value">${c(o.value)}</p>${d}${l}</div>`}).join("")}</div>`);break;case"code":a.push(Se(n,t,g(n,e)));break;case"columns":{const o=n.columns.map(d=>`${String(d.width??1)}fr`).join(" "),r=ee(n,t.room);a.push(`<div class="columns${columnsKept(n,q(t.page))?" kept":""}"${g(n,e)} style="grid-template-columns:${o}">${n.columns.map((d,l)=>`<div class="column">${y(d.blocks,{...t,room:r[l]??G},e)}</div>`).join("")}</div>`);break}case"chart":{const o=e.numbers.get(n),r=o===void 0?n:we(n),{svg:d,problems:l}=V(r,{...t,font:pageFaces(t.page).text}),{width:f}=Q(n,t.room),u=o===void 0||n.title===void 0?"":`<figcaption>${c(M(n.title,o))}</figcaption>`;a.push(d===void 0?`<div class="embed"${g(n,e)} data-chart>${c(n.title??"Chart")}<br><small>${c(l.join("; "))}</small></div>`:`<figure class="chart"${P(n.id)}${g(n,e)} style="max-width:${String(f)}px">${d}${u}</figure>`);break}case"image":{const o=t.image?.(n.src)??n.src;a.push(`<figure${P(n.id)}${g(n,e)}${n.align===void 0?"":` style="text-align:${n.align}"`}><img src="${c(o)}" alt="${c(n.alt??"")}"${n.width===void 0?"":` width="${String(n.width)}"`}>${n.caption===void 0?"":`<figcaption>${c(M(n.caption,e.numbers.get(n)))}</figcaption>`}</figure>`);break}case"table":{const o=n.head===void 0||n.head==="both",r=n.head==="column"||n.head==="both",d=fe(n),l=(h,m,$)=>`<tr${e.ids===void 0?"":` data-row="${String($)}"`}>${h.map((w,j)=>{const F=m||r&&j===0?"th":"td",Z=d.has(j)?' class="num"':"";return`<${F}${Z}>${k(w,e)}</${F}>`}).join("")}</tr>`,f=pe(n),u=f.reduce((h,m,$)=>h+(n.widths?.[$]??0),0),S=f.reduce((h,m,$)=>h+(n.widths?.[$]?0:m),0)||1,N=`<colgroup>${f.map((h,m)=>{const $=n.widths?.[m],w=b(h/S*100);return $?`<col style="width:${String($)}px">`:u===0?`<col style="width:${w}%">`:`<col style="width:calc((100% - ${String(u)}px) * ${b(h/S)})">`}).join("")}</colgroup>`,[v,...E]=n.rows,H=o&&v!==void 0?`<thead>${l(v,!0,0)}</thead>`:"",z=(o?E:n.rows).map((h,m)=>l(h,!1,o?m+1:m)).join(""),T=n.caption===void 0?"":`<caption>${c(M(n.caption,e.numbers.get(n)))}</caption>`;a.push(`<table${P(n.id)}${g(n,e)}>${T}${N}${H}<tbody>${z}</tbody></table>`);break}case"divider":a.push(`<hr${g(n,e)}>`);break;case"pagebreak":a.push(`<div class="page-break"${g(n,e)}></div>`);break;case"toc":a.push(ke(n,e));break;case"bibliography":e.listed||(e.listed=!0,a.push(K(e,g(n,e))));break;case"note":break;case"component":{const o=t.component?.(n),r=n.align===void 0?"":` style="text-align:${n.align}"`;a.push(o===void 0?`<div class="embed"${g(n,e)} data-component>${c(ne(n))}</div>`:`<figure${P(n.id)}${g(n,e)}${r}><img src="${c(o)}" alt="${c(n.alt??"")}"${n.width===void 0?"":` width="${String(n.width)}"`}>${n.caption===void 0?"":`<figcaption>${c(M(n.caption,e.numbers.get(n)))}</figcaption>`}</figure>`);break}case"embed":{const o=t.embed?.(n.source,e.embeds);e.embeds++;const r=/^<\s*([A-Za-z][\w.]*)/.exec(n.source.trim())?.[1];a.push(o===void 0?`<div class="embed"${g(n,e)} data-embed>${c(r??"")}</div>`:`<div${g(n,e)}>${o}</div>`);break}case"source":break}}return a.join(`
3
- `)}function K(i,t=""){const{list:e,style:a}=i.sources;return e.length===0?"":`<section class="sources" data-style="${a}"${t}><ol>${e.map(s=>`<li id="source-${c(s.item.id)}">${s.pieces.map(n=>n.italic?`<i>${c(n.text)}</i>`:c(n.text)).join("")}</li>`).join("")}</ol></section>`}const we=i=>{const t={...i};return delete t.title,t},P=i=>i===void 0?"":` id="${c(i)}"`;function ke(i,t){const e=i.levels??3,a=t.headings.filter(r=>r.block.level<=e),s=Math.min(...a.map(r=>r.block.level)),n=a.map(({block:r,anchor:d})=>{const l=t.headingPage?.(d);return`<li style="padding-left:${String(r.level-s)}em"><a href="#${c(d)}"><span class="toc-words">${k(r.content,t)}</span>${l===void 0?"":`<span class="toc-fill"></span><span class="toc-page">${String(l)}</span>`}</a></li>`}),o=de(i,t.chinese);return`<nav class="toc"${g(i,t)}>${o===""?"":`<p class="toc-title">${c(o)}</p>`}<ol>${n.join("")}</ol></nav>`}export function keptWhole(i,t,e=0){const a=.35277777777777775,s="pt"in t.lineHeight?t.lineHeight.pt:t.lineHeight.multiple*(I[t.font]??1.22)*t.size,n=Math.max(20,(t.textWidth/a-30)/(t.size*.5)),o=r=>r.reduce((d,l)=>{if(l.type==="table")return d+l.rows.length*1.6+1;if(l.type==="chart"||l.type==="image"||l.type==="component")return d+18;if(l.type==="card")return d+2+o(l.children??[]);const f="content"in l?Math.max(1,Math.ceil(l.content.map(u=>u.text).join("").length/n))+.5:2;return d+f+o(me(l))},0);return(e+o(i))*s<t.textHeight/a*.6}export const cardKept=(i,t)=>keptWhole(i.children??[],t,2),columnsKept=(i,t)=>i.columns.every(e=>keptWhole(e.blocks,t));const ye=15;export function trendSvg(i,t){const s=Math.min(...i),o=Math.max(...i)-s||1,d=i.map((l,f)=>[f/Math.max(1,i.length-1)*100,22-(l-s)/o*20]).map(([l,f],u)=>`${u===0?"M":"L"}${(l??0).toFixed(1)} ${(f??0).toFixed(1)}`).join(" ");return`<svg class="stat-trend" viewBox="0 0 ${String(100)} ${String(24)}" preserveAspectRatio="none" aria-hidden="true"><path d="${d}" fill="none" stroke="${t}" stroke-width="1.5" vector-effect="non-scaling-stroke" stroke-linejoin="round" stroke-linecap="round"/></svg>`}function Se(i,t,e=""){if(i.language===B.math)return`<div class="math"${e}>${ce(i.code).html}</div>`;if(i.language===B.mermaid){const a=t.diagram?.(i.code);if(a?.svg!==void 0)return`<figure class="diagram"${e}>${a.svg}</figure>`;if(a?.error!==void 0)return`<pre${e}><code>${c(i.code)}</code></pre><p class="drawn-error">Mermaid: ${c(a.error)}</p>`}return`<pre${e}><code>${ve(i.code)}</code></pre>`}const ve=i=>i.split(`
4
- `).map(t=>`<span class="line">${c(t)}</span>`).join(""),O=(i,t,e)=>i?.length?`<div class="under">${y(i,t,e)}</div>`:"";export const DOC_CSS=`
2
+ import{chartColor as te,chartFrame as ne,docChartSvg as ie}from"./chart.js";import{BACKGROUNDS as B,TEXT_COLORS as D}from"./color.js";import{columnWidths as oe,COLUMN_GAP as ae}from"./columns.js";import{COMPONENT_WIDTH as U,componentName as se}from"./component.js";import{citationText as re,citedOf as de,sourceList as le}from"./cite.js";import{blockId as ce,captionNumbers as pe,contentsTitle as fe,numberedCaption as R,writtenInChinese as he,withoutTitle as ge}from"./captions.js";import{DRAWN_CODE as K,mathHtml as ue}from"./math.js";import{charsAcross as X,columnShares as me,emptyHead as $e,numberColumns as be}from"./table.js";import{splitTitle as xe}from"./title.js";import{PAPER as c,TONE_COLORS as J,tagColors as we}from"./paper.js";import{COVER_HEIGHT_MM as ke,everyBlock as q,innerBlocks as ye,noteNumbers as Se,statTone as ve}from"./model.js";import{effectiveLook as I,lineMultiple as Ce,resolvePage as j,SINGLE_LINE as _}from"./page.js";export const PAGE_FACES={sans:'Carlito, Calibri, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif',serif:'Caladea, Cambria, "Noto Serif SC", "Songti SC", Georgia, serif',times:'Tinos, "Times New Roman", Times, "Noto Serif SC", serif',mono:'Cousine, "Courier New", "Noto Sans SC", monospace',song:'"Noto Serif SC", "Songti SC", SimSun, "宋体", serif',hei:'"Noto Sans SC", "PingFang SC", SimHei, "黑体", sans-serif',fangsong:'FangSong, STFangsong, "仿宋", "FangSong_GB2312", "Noto Serif SC", serif',kai:'"LXGW WenKai", KaiTi, STKaiti, "楷体", "Noto Serif SC", serif',xiaobiaosong:'"FZXiaoBiaoSong-B05S", "方正小标宋简体", "Noto Serif SC", "Songti SC", serif'};export function pageFaces(i={}){const n=I(i).font??"sans";return{text:PAGE_FACES[n],heading:PAGE_FACES[n],mono:PAGE_FACES.mono}}export const pageAccent=(i={})=>i.accent===void 0?void 0:te(i.accent);export{BACKGROUNDS,TEXT_COLORS}from"./color.js";export function blockNumbers(i){const n=new Map;for(const e of q(i))n.set(e,n.size);return n}const p=i=>i.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),H=(i,n)=>n[i]??(/^(#[0-9a-f]{3,8}|[a-z]+|(rgb|hsl)a?\([\d\s.,%/]+\))$/i.test(i)?i:void 0),h=(i,n)=>{const e=n.ids?.get(i);return e===void 0?"":` data-b="${String(e)}"`};export function headingAnchors(i){const n=new Map,e=new Map;for(const a of q(i)){if(a.type!=="heading")continue;const s=a.content.map(r=>r.text).join("").trim().toLowerCase().replace(/[^\p{L}\p{N}\s-]/gu,"").replace(/\s/gu,"-"),t=s===""?"section":s,o=e.get(t)??0;e.set(t,o+1),n.set(a,o===0?t:`${t}-${String(o)}`)}return n}function w(i,n){return i.map(e=>{if(e.cite!==void 0){const{items:d,numbers:l,style:f}=n.sources,g=de(e.cite).keys[0],k=p(re(e.cite,d,l,f));return g!==void 0&&l.has(g)?`<a class="cite" href="#source-${p(g)}">${k}</a>`:`<span class="cite">${k}</span>`}if(e.note!==void 0){const d=n.notes.get(e.note.toLowerCase());return d===void 0?`<sup class="fn">[${p(e.note)}]</sup>`:`<sup class="fn"><a href="#note-${String(d)}">${String(d)}</a></sup>`}const a=e.text===""&&e.href?.startsWith("#")===!0?n.refs.get(decodeURIComponent(e.href.slice(1)))??"":e.text;let s=p(a).replace(/\n/g,"<br>");const t=e.styles;t.code&&(s=`<code>${s}</code>`),t.strike&&(s=`<s>${s}</s>`),t.italic&&(s=`<em>${s}</em>`),t.bold&&(s=`<strong>${s}</strong>`),t.underline&&(s=`<u>${s}</u>`);const o=t.color===void 0?void 0:H(t.color,D),r=t.background===void 0?void 0:H(t.background,B);if((o!==void 0||r!==void 0)&&(s=`<span style="${o===void 0?"":`color:${o};`}${r===void 0?"":`background:${r};`}">${s}</span>`),t.tag!==void 0){const d=we(t.tag);s=`<span class="tag" style="background:${d.bg};color:${d.fg}">${s}</span>`}return e.href!==void 0&&/^(https?:|mailto:|#|\/|\.)/i.test(e.href)&&(s=`<a href="${p(e.href)}">${s}</a>`),s}).join("")}function N(i,n=!1){if(!i)return"";const e=i.color===void 0?void 0:H(i.color,D),a=i.background===void 0?void 0:H(i.background,B),s=[i.align===void 0?"":`text-align:${i.align};`,e===void 0?"":`color:${e};`,a===void 0?"":n?`background:${a};`:`background:${a};padding:0.15em 0.4em;border-radius:3px;`].join("");return s===""?"":` style="${s}"`}const Z=i=>i.type==="bullet"||i.type==="numbered"||i.type==="check";function y(i,n,e){const a=[];let s=0;for(;s<i.length;){const t=i[s];if(t===void 0)break;if(Z(t)){const o=t.type==="numbered";let r=s;const d=[];for(;r<i.length;){const f=i[r];if(!f||!Z(f)||f.type==="numbered"!==o)break;const g=f.type==="check"?`<span class="box${f.checked?" done":""}"></span>`:"";d.push(`<li${h(f,e)}${f.type==="check"?` class="task${f.checked?" done":""}"`:""}${N(f.look)}>${g}<span class="words">${w(f.content,e)}</span>${y(f.children??[],n,e)}</li>`),r++}const l=t.type==="numbered"&&t.start!==void 0?` start="${String(t.start)}"`:"";a.push(o?`<ol${l}>${d.join("")}</ol>`:`<ul>${d.join("")}</ul>`),s=r;continue}switch(s++,t.type){case"paragraph":a.push(`<p${h(t,e)}${N(t.look)}>${w(t.content,e)||"&nbsp;"}</p>${L(t.children,n,e)}`);break;case"heading":{const o=`h${String(t.level)}`;a.push(`<${o} id="${p(e.anchors.get(t)??"")}"${h(t,e)}${N(t.look)}>${w(t.content,e)}</${o}>${L(t.children,n,e)}`);break}case"toggle":a.push(`<p${h(t,e)}${N(t.look)}>${w(t.content,e)}</p>${L(t.children,n,e)}`);break;case"quote":a.push(`<blockquote${h(t,e)}${N(t.look)}><p>${w(t.content,e)}</p>${y(t.children??[],n,e)}</blockquote>`);break;case"callout":a.push(`<div class="callout"${h(t,e)}${N(t.look,!0)}>${t.icon===void 0?"":`<span class="callout-icon">${p(t.icon)}</span>`}<div><p>${w(t.content,e)}</p>${y(t.children??[],n,e)}</div></div>`);break;case"card":a.push(`<div class="card${cardKept(t,j(n.page))?" kept":""}"${h(t,e)}>${t.title===void 0&&t.subtitle===void 0?"":`<div class="card-head">${t.title===void 0?"":`<p class="card-title">${p(t.title)}</p>`}${t.subtitle===void 0?"":`<p class="card-subtitle">${p(t.subtitle)}</p>`}</div>`}${y(t.children??[],{...n,room:(n.room??U)-2*ze},e)}</div>`);break;case"stats":a.push(`<div class="stats"${h(t,e)} style="grid-template-columns:repeat(${String(t.stats.length)},minmax(0,1fr))">${t.stats.map(o=>{const r=ve(o),d=o.delta===void 0&&o.note===void 0?"":`<p class="stat-foot">${o.delta===void 0?"":`<span class="stat-delta" style="color:${J[r]}">${p(o.delta)}</span>`}${o.delta!==void 0&&o.note!==void 0?" ":""}${o.note===void 0?"":p(o.note)}</p>`,l=o.trend===void 0?"":trendSvg(o.trend,J[r==="flat"?"flat":r]);return`<div class="stat"><p class="stat-label">${p(o.label)}</p><p class="stat-value">${p(o.value)}</p>${d}${l}</div>`}).join("")}</div>`);break;case"code":a.push(Te(t,n,h(t,e)));break;case"columns":{const o=t.columns.map(d=>`${String(d.width??1)}fr`).join(" "),r=oe(t,n.room);a.push(`<div class="columns${columnsKept(t,j(n.page))?" kept":""}"${h(t,e)} style="grid-template-columns:${o}">${t.columns.map((d,l)=>`<div class="column">${y(d.blocks,{...n,room:r[l]??U},e)}</div>`).join("")}</div>`);break}case"chart":{const o=e.numbers.get(t),r=o===void 0?t:ge(t),{svg:d,problems:l}=ie(r,{...n,font:pageFaces(n.page).text}),{width:f}=ne(t,n.room),g=o===void 0||t.title===void 0?"":`<figcaption>${p(R(t.title,o))}</figcaption>`;a.push(d===void 0?`<div class="embed"${h(t,e)} data-chart>${p(t.title??"Chart")}<br><small>${p(l.join("; "))}</small></div>`:`<figure class="chart"${P(t.id)}${h(t,e)} style="max-width:${String(f)}px">${d}${g}</figure>`);break}case"image":{const o=n.image?.(t.src)??t.src;a.push(`<figure${P(t.id)}${h(t,e)}${t.align===void 0?"":` style="text-align:${t.align}"`}><img src="${p(o)}" alt="${p(t.alt??"")}"${t.width===void 0?"":` width="${String(t.width)}"`}>${t.caption===void 0?"":`<figcaption>${p(R(t.caption,e.numbers.get(t)))}</figcaption>`}</figure>`);break}case"table":{const o=t.head===void 0||t.head==="both",r=t.head==="column"||t.head==="both",d=be(t),l=$e(t),f=(m,b,T)=>`<tr${e.ids===void 0?"":` data-row="${String(T)}"`}>${m.map((F,W)=>{const G=b||r&&W===0?"th":"td",ee=d.has(W)?' class="num"':"";return`<${G}${ee}>${w(F,e)}</${G}>`}).join("")}</tr>`,g=j(n.page),k=(t.widths??[]).reduce((m,b)=>m+(b??0),0),M=n.room??g.textWidth*96/25.4,C=me(t,{across:X(Math.max(M-k,0),g.spacing.small),margins:X(2*g.spacing.cell.side*96/72,g.spacing.small)}),E=C.reduce((m,b,T)=>m+(t.widths?.[T]?0:b),0)||1,O=`<colgroup>${C.map((m,b)=>{const T=t.widths?.[b],F=$(m/E*100);return T?`<col style="width:${String(T)}px">`:k===0?`<col style="width:${F}%">`:`<col style="width:calc((100% - ${String(k)}px) * ${$(m/E)})">`}).join("")}</colgroup>`,[z,...A]=t.rows,u=o&&z!==void 0&&!l?`<thead>${f(z,!0,0)}</thead>`:"",S=(o?A:t.rows).map((m,b)=>f(m,!1,o?b+1:b)).join(""),v=t.caption===void 0?"":`<caption>${p(R(t.caption,e.numbers.get(t)))}</caption>`;a.push(`<table${P(t.id)}${h(t,e)}>${v}${O}${u}<tbody>${S}</tbody></table>`);break}case"divider":a.push(`<hr${h(t,e)}>`);break;case"pagebreak":a.push(`<div class="page-break"${h(t,e)}></div>`);break;case"toc":a.push(Ee(t,e));break;case"bibliography":e.listed||(e.listed=!0,a.push(Y(e,h(t,e))));break;case"note":break;case"component":{const o=n.component?.(t),r=t.align===void 0?"":` style="text-align:${t.align}"`;a.push(o===void 0?`<div class="embed"${h(t,e)} data-component>${p(se(t))}</div>`:`<figure${P(t.id)}${h(t,e)}${r}><img src="${p(o)}" alt="${p(t.alt??"")}"${t.width===void 0?"":` width="${String(t.width)}"`}>${t.caption===void 0?"":`<figcaption>${p(R(t.caption,e.numbers.get(t)))}</figcaption>`}</figure>`);break}case"embed":{const o=n.embed?.(t.source,e.embeds);e.embeds++;const r=/^<\s*([A-Za-z][\w.]*)/.exec(t.source.trim())?.[1];a.push(o===void 0?`<div class="embed"${h(t,e)} data-embed>${p(r??"")}</div>`:`<div${h(t,e)}>${o}</div>`);break}case"source":break}}return a.join(`
3
+ `)}function Y(i,n=""){const{list:e,style:a}=i.sources;return e.length===0?"":`<section class="sources" data-style="${a}"${n}><ol>${e.map(s=>`<li id="source-${p(s.item.id)}">${s.pieces.map(t=>t.italic?`<i>${p(t.text)}</i>`:p(t.text)).join("")}</li>`).join("")}</ol></section>`}const P=i=>i===void 0?"":` id="${p(i)}"`;function Ee(i,n){const e=i.levels??3,a=n.headings.filter(r=>r.block.level<=e),s=Math.min(...a.map(r=>r.block.level)),t=a.map(({block:r,anchor:d})=>{const l=n.headingPage?.(d);return`<li style="padding-left:${String(r.level-s)}em"><a href="#${p(d)}"><span class="toc-words">${w(r.content,n)}</span>${l===void 0?"":`<span class="toc-fill"></span><span class="toc-page">${String(l)}</span>`}</a></li>`}),o=fe(i,n.chinese);return`<nav class="toc"${h(i,n)}>${o===""?"":`<p class="toc-title">${p(o)}</p>`}<ol>${t.join("")}</ol></nav>`}export function keptWhole(i,n,e=0){const a=.35277777777777775,s="pt"in n.lineHeight?n.lineHeight.pt:n.lineHeight.multiple*(_[n.font]??1.22)*n.size,t=Math.max(20,(n.textWidth/a-30)/(n.size*.5)),o=r=>r.reduce((d,l)=>{if(l.type==="table")return d+l.rows.length*1.6+1;if(l.type==="chart"||l.type==="image"||l.type==="component")return d+18;if(l.type==="card")return d+2+o(l.children??[]);const f="content"in l?Math.max(1,Math.ceil(l.content.map(g=>g.text).join("").length/t))+.5:2;return d+f+o(ye(l))},0);return(e+o(i))*s<n.textHeight/a*.6}export const cardKept=(i,n)=>keptWhole(i.children??[],n,2),columnsKept=(i,n)=>i.columns.every(e=>keptWhole(e.blocks,n));const ze=15;export function trendSvg(i,n){const s=Math.min(...i),o=Math.max(...i)-s||1,d=i.map((l,f)=>[f/Math.max(1,i.length-1)*100,22-(l-s)/o*20]).map(([l,f],g)=>`${g===0?"M":"L"}${(l??0).toFixed(1)} ${(f??0).toFixed(1)}`).join(" ");return`<svg class="stat-trend" viewBox="0 0 ${String(100)} ${String(24)}" preserveAspectRatio="none" aria-hidden="true"><path d="${d}" fill="none" stroke="${n}" stroke-width="1.5" vector-effect="non-scaling-stroke" stroke-linejoin="round" stroke-linecap="round"/></svg>`}function Te(i,n,e=""){if(i.language===K.math)return`<div class="math"${e}>${ue(i.code).html}</div>`;if(i.language===K.mermaid){const a=n.diagram?.(i.code);if(a?.svg!==void 0)return`<figure class="diagram"${e}>${a.svg}</figure>`;if(a?.error!==void 0)return`<pre${e}><code>${p(i.code)}</code></pre><p class="drawn-error">Mermaid: ${p(a.error)}</p>`}return`<pre${e}><code>${Ne(i.code)}</code></pre>`}const Ne=i=>i.split(`
4
+ `).map(n=>`<span class="line">${p(n)}</span>`).join(""),L=(i,n,e)=>i?.length?`<div class="under">${y(i,n,e)}</div>`:"";export const DOC_CSS=`
5
5
  /* The page's side margins are the text column's own padding, so a cover
6
6
  can reach the page's edges. The default page is Letter (PAGE_DEFAULTS). */
7
7
  @page { size: 215.9mm 279.4mm; margin: 18mm 0; }
8
8
  * { box-sizing: border-box; }
9
9
  html { font-size: 11pt; }
10
- body { margin: 0; color: ${p.ink}; font-family: Carlito, Calibri, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif; line-height: 1.4; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
10
+ body { margin: 0; color: ${c.ink}; font-family: Carlito, Calibri, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif; line-height: 1.4; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
11
11
  main { max-width: 215.9mm; margin: 0 auto; padding: 0 20mm; overflow-x: clip; }
12
12
  /* Every block's space and step in is the page's (pageCss, from BlockSpacing). */
13
13
  h1, h2, h3, h4, h5, h6 { line-height: inherit; margin: 0; break-after: avoid; }
@@ -19,81 +19,84 @@ h2 { font-size: 1.45em; }
19
19
  .toc-title { font-weight: bold; line-height: inherit; break-after: avoid; }
20
20
  h3 { font-size: 1.15em; }
21
21
  h4, h5, h6 { font-size: 1em; }
22
- h5 { color: ${p.lead}; }
23
- h6 { color: ${p.leadSoft}; font-weight: 500; }
22
+ h5 { color: ${c.lead}; }
23
+ h6 { color: ${c.leadSoft}; font-weight: 500; }
24
24
  p, ul, ol, li { margin: 0; }
25
25
  ul, ol { padding-left: 0; }
26
26
  /* A task as the editor draws it: a box, ticked and the words struck when done. */
27
27
  li.task { list-style: none; }
28
- li.task .box { display: inline-block; width: 0.95em; height: 0.95em; margin-right: 0.55em; border: 1.5px solid ${p.ruleStrong}; border-radius: 3px; vertical-align: -0.14em; }
29
- li.task .box.done { border-color: ${p.ink}; background: ${p.ink} url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.3 2.3 4.7-4.9' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 85% no-repeat; }
30
- li.task.done > .words { color: ${p.leadSoft}; text-decoration: line-through; text-decoration-color: ${p.ruleStrong}; }
31
- blockquote { margin: 0; border-left: var(--quote-rule, 1px) solid ${p.ruleStrong}; color: ${p.lead}; }
32
- code { font-family: Cousine, "Courier New", monospace; font-size: 0.88em; background: ${p.stone2}; border-radius: 3px; padding: 0.12em 0.34em; }
33
- pre { margin: 0; font-family: Cousine, "Courier New", monospace; background: ${p.stone}; border: 0.5pt solid ${p.stone}; border-radius: 6px; white-space: pre-wrap; overflow-wrap: anywhere; break-inside: avoid; }
28
+ li.task .box { display: inline-block; width: 0.95em; height: 0.95em; margin-right: 0.55em; border: 1.5px solid ${c.ruleStrong}; border-radius: 3px; vertical-align: -0.14em; }
29
+ li.task .box.done { border-color: ${c.ink}; background: ${c.ink} url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.3 2.3 4.7-4.9' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 85% no-repeat; }
30
+ li.task.done > .words { color: ${c.leadSoft}; text-decoration: line-through; text-decoration-color: ${c.ruleStrong}; }
31
+ blockquote { margin: 0; border-left: var(--quote-rule, 1px) solid ${c.ruleStrong}; color: ${c.lead}; }
32
+ code { font-family: Cousine, "Courier New", monospace; font-size: 0.88em; background: ${c.stone2}; border-radius: 3px; padding: 0.12em 0.34em; }
33
+ pre { margin: 0; font-family: Cousine, "Courier New", monospace; background: ${c.stone}; border: 0.5pt solid ${c.stone}; border-radius: 6px; white-space: pre-wrap; overflow-wrap: anywhere; break-inside: avoid; }
34
34
  pre code { background: none; padding: 0; }
35
35
  pre .line { display: block; min-height: 1lh; padding-left: 2ch; text-indent: -2ch; }
36
- /* Tables as the editor sets them (Notion's): rows apart by hairlines, no
37
- lines between columns, a head over a stronger rule; laid out as Word
38
- lays them, each column as wide as it is set, the rest shared. */
36
+ /* Tables as the editor sets them, a report's three rules (booktabs): a
37
+ strong rule over and under, the head on its ground over a rule, rows apart
38
+ by lines, no lines between columns; laid
39
+ out as Word lays them, each column as wide as it is set, the rest shared. */
39
40
  table { border-collapse: collapse; width: 100%; table-layout: fixed; }
40
- th, td { border: 0; border-bottom: 0.5pt solid ${p.rule}; text-align: left; vertical-align: top; }
41
+ th, td { border: 0; border-bottom: 0.5pt solid ${c.ruleMid}; text-align: left; vertical-align: top; }
42
+ table > thead > tr:first-child > *, table:not(:has(> thead)) > tbody > tr:first-child > * { border-top: 1pt solid ${c.ruleStrong}; }
43
+ table > tbody > tr:last-child > * { border-bottom: 1pt solid ${c.ruleStrong}; }
41
44
  th { font-weight: 600; }
42
- thead th { border-bottom-color: ${p.ruleStrong}; font-weight: normal; color: ${p.lead}; }
45
+ thead th { border-bottom: 0.75pt solid ${c.ruleStrong}; background: ${c.stone3}; }
43
46
  th.num, td.num { text-align: right; }
44
47
  /* An emoji drawn as a picture of itself (EMOJI_PICTURES): an em square on the line, as Twemoji sets one. */
45
48
  img.emoji { display: inline; width: 1em; height: 1em; margin: 0 0.05em; vertical-align: -0.12em; }
46
49
  figure { break-inside: avoid; }
47
50
  img { max-width: 100%; }
48
- figcaption { color: ${p.leadSoft}; }
49
- hr { box-sizing: content-box; border: 0; border-bottom: 0.5pt solid ${p.rule}; }
50
- a { color: inherit; text-decoration: underline; text-decoration-color: ${p.ruleStrong}; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
51
+ figcaption { color: ${c.leadSoft}; }
52
+ hr { box-sizing: content-box; border: 0; border-bottom: 0.5pt solid ${c.rule}; }
53
+ a { color: inherit; text-decoration: underline; text-decoration-color: ${c.ruleStrong}; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
51
54
  /* A callout's sign in a column of its own, as wide as Word's cell for it. */
52
55
  /* A card: blocks in a hairline border under a title and a quieter line. */
53
- .card { border: 0.5pt solid ${p.rule}; border-radius: 8px; background: ${p.sheet}; }
56
+ .card { border: 0.5pt solid ${c.rule}; border-radius: 8px; background: ${c.sheet}; }
54
57
  .card.kept, .columns.kept { break-inside: avoid; }
55
58
  .card-head p { margin: 0; }
56
59
  .card-title { font-weight: 700; }
57
- .card-subtitle { color: ${p.lead}; }
60
+ .card-subtitle { color: ${c.lead}; }
58
61
  /* Figures side by side: each a label over its value, how it moved under it. */
59
62
  .stats { display: grid; break-inside: avoid; }
60
- .stat { border: 0.5pt solid ${p.rule}; border-radius: 8px; background: ${p.sheet}; }
63
+ .stat { border: 0.5pt solid ${c.rule}; border-radius: 8px; background: ${c.sheet}; }
61
64
  .stat p { margin: 0; }
62
- .stat-label, .stat-foot { color: ${p.lead}; }
63
- .stat-value { font-weight: 700; color: ${p.ink}; }
65
+ .stat-label, .stat-foot { color: ${c.lead}; }
66
+ .stat-value { font-weight: 700; color: ${c.ink}; }
64
67
  .stat-trend { display: block; width: 100%; height: 18pt; margin-top: 3pt; }
65
68
  /* A tag: a word or two in a pill of its colour. */
66
69
  .tag { border-radius: 999px; padding: 0 0.4em; font-size: 0.85em; }
67
- .callout { display: flex; border-radius: 6px; background: ${p.stone}; break-inside: avoid; }
70
+ .callout { display: flex; border-radius: 6px; background: ${c.stone}; break-inside: avoid; }
68
71
  .callout-icon { flex: none; width: 1.8em; }
69
72
  .callout > div { flex: 1; min-width: 0; }
70
- .embed { border: 1px dashed ${p.ruleMid}; border-radius: 6px; padding: 1.5em; text-align: center; color: ${p.leadSoft}; break-inside: avoid; }
73
+ .embed { border: 1px dashed ${c.ruleMid}; border-radius: 6px; padding: 1.5em; text-align: center; color: ${c.leadSoft}; break-inside: avoid; }
71
74
  /* A cover: a band of a picture across the top of the first page, edge to
72
75
  edge (Notion's). */
73
- .cover { height: ${String(ue)}mm; margin: 0 -20mm 2.4em; overflow: hidden; break-inside: avoid; }
76
+ .cover { height: ${String(ke)}mm; margin: 0 -20mm 2.4em; overflow: hidden; break-inside: avoid; }
74
77
  .cover img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; }
75
78
  /* A footnote's mark, and the notes at the end under a short rule. */
76
79
  sup.fn { font-size: 0.72em; line-height: 0; margin-left: 0.02em; font-variant-numeric: tabular-nums; }
77
- sup.fn a { text-decoration: none; color: ${p.lead}; }
78
- .notes { margin-top: 2.5em; padding-top: 0.8em; border-top: 1px solid ${p.rule}; width: 100%; font-size: 0.85em; color: ${p.lead}; }
80
+ sup.fn a { text-decoration: none; color: ${c.lead}; }
81
+ .notes { margin-top: 2.5em; padding-top: 0.8em; border-top: 1px solid ${c.rule}; width: 100%; font-size: 0.85em; color: ${c.lead}; }
79
82
  .notes ol { padding-left: 1.6em; margin: 0; }
80
83
  .notes li { margin: 0.25em 0; }
81
84
  .notes li p { margin: 0; }
82
85
  .page-break { break-after: page; height: 0; }
83
86
  /* A mark set half wide at a line's end, as Word squeezes it (GRID_SQUEEZE). */
84
87
  .squeezed { letter-spacing: -0.5em; }
85
- caption { caption-side: top; text-align: left; color: ${p.leadSoft}; }
88
+ caption { caption-side: top; text-align: left; color: ${c.leadSoft}; }
86
89
  /* The contents: each heading a link, its page after a line of dots. */
87
90
  .toc ol { list-style: none; padding: 0; }
88
91
  .toc a { display: flex; align-items: baseline; gap: 0.4em; color: inherit; text-decoration: none; }
89
- .toc-fill { flex: 1; min-width: 1em; border-bottom: 1px dotted ${p.ruleMid}; }
92
+ .toc-fill { flex: 1; min-width: 1em; border-bottom: 1px dotted ${c.ruleMid}; }
90
93
  .toc-page { font-variant-numeric: tabular-nums; }
91
94
  /* Citations and the list of sources: numbered with a hanging number (GB/T 7714), or by author with a hanging line (APA, MLA) as deep as a paragraph's first line is set in (--hang). */
92
95
  a.cite { color: inherit; text-decoration: none; }
93
96
  .sources ol { list-style: none; padding-left: 0; }
94
97
  .sources li { text-align: left; text-indent: calc(-1 * var(--hang, 2em)); padding-left: var(--hang, 2em); }
95
98
  .sources[data-style="gbt7714"] li { --hang: 2.2em; }
96
- .columns { display: grid; gap: 0 ${String(te)}px; }
99
+ .columns { display: grid; gap: 0 ${String(ae)}px; }
97
100
  .column { min-width: 0; }
98
101
  .column > :first-child, .callout > div > :first-child { margin-top: 0; }
99
102
  figure.chart { margin-left: auto; margin-right: auto; }
@@ -109,8 +112,8 @@ figure.chart svg, figure.diagram svg { display: inline-block; max-width: 100%; h
109
112
  a row never split, a table's head again on each page. */
110
113
  p, li { orphans: 2; widows: 2; }
111
114
  tr { break-inside: avoid; }
112
- `;function Ce(i,t,e){const a=[...A(i)].filter(o=>o.type==="note");return a.length===0?"":`<section class="notes"><ol>${a.map(o=>({note:o,n:e.notes.get(o.label.toLowerCase())})).sort((o,r)=>(o.n??1/0)-(r.n??1/0)).map(({note:o,n:r})=>`<li${g(o,e)}${r===void 0?"":` id="note-${String(r)}" value="${String(r)}"`}><p>${k(o.content,e)}</p>${y(o.children??[],t,e)}</li>`).join("")}</ol></section>`}const X="body > h1:first-child, main > h1:first-child, article > h1:first-child, main > .cover + h1",x=i=>`${String(Math.round(i*100)/100)}mm`,b=i=>String(Math.round(i*1e3)/1e3);function Ee(i){const t=i.spacing,e=o=>`${b(o)}pt`,a=e(t.after),s=e(t.step),n="pt"in i.lineHeight?e(i.lineHeight.pt):b(i.lineHeight.multiple*(I.mono??1));return[`p, ul, ol, blockquote, pre, table, figure, .math, .callout, .card, .stats, .embed, .sources li { margin: 0 0 ${a}; }`,`h1, h2, h3, h4, h5, h6 { margin: ${e(t.heading.before)} 0 ${e(t.heading.after)}; }`,`.toc-title { margin: ${e(t.heading.before)} 0 ${e(t.heading.after)}; }`,`${X} { margin-top: 0; margin-bottom: ${e(t.title)}; }`,`ul, ol { padding-left: ${s}; } li ul, li ol { margin-bottom: 0; } li.task { margin-left: -${s}; } .under { margin-left: ${s}; }`,`:is(ul, ol) + :is(ul, ol) { margin-top: -${a}; }`,`blockquote { padding-left: calc(${e(t.quote)} - var(--quote-rule, 1px)); }`,`pre { padding: ${e(t.box.top)} ${e(t.box.side)}; font-size: ${e(t.small)}; line-height: ${n}; } pre code { font-size: inherit; }`,`.callout { padding: ${e(t.box.top)} ${e(t.box.side)} ${e(Math.max(t.box.top-t.after,0))}; }`,`.card { padding: ${e(t.card.top)} ${e(t.card.side)} ${e(Math.max(t.card.top-t.after,0))}; } .card-head { margin-bottom: ${a}; } .card-subtitle { font-size: ${e(t.small)}; }`,`.stats { gap: ${e(t.gap)}; } .stat { padding: ${e(t.card.top)} ${e(t.card.side)}; } .stat-label, .stat-foot { font-size: ${e(t.small)}; } .stat-value { font-size: ${e(t.figure)}; line-height: ${b(I[i.font]??I.sans??1.22)}; }`,`table { font-size: ${e(t.small)}; } th, td { padding: ${e(t.cell.top)} ${e(t.cell.side)}; } :is(th, td):first-child { padding-left: 0; } :is(th, td):last-child { padding-right: 0; }`,`caption { font-size: ${e(t.small)}; padding-bottom: ${e(t.caption)}; }`,`figcaption { font-size: ${e(t.small)}; margin-top: ${e(t.caption)}; }`,`hr { height: 1pt; margin: ${e(t.divider)} 0; }`,`.toc ol { margin: 0; } .toc li { margin: 0 0 ${e(t.contents)}; } .sources ol { margin: 0; }`]}function J(i,t,e){if(t===void 0)return;const a=[t.font===void 0?"":`font-family: ${PAGE_FACES[e.font]};`,t.size===void 0?"":`font-size: ${b(e.size)}pt;`,e.font==="xiaobiaosong"?"font-weight: 700;":t.weight===void 0?"":`font-weight: ${e.weight==="bold"?"700":"400"};`,t.align===void 0?"":`text-align: ${e.align};`,t.italic===void 0?"":`font-style: ${e.italic?"italic":"normal"};`,e.rule?`border-bottom: 0.5pt solid ${p.rule}; padding-bottom: ${b(HEADING_RULE_SPACE)}pt;`:""].join(" ");return a.trim()===""?void 0:`${i} { ${a.trim()} }`}export const HEADING_RULE_SPACE=3;export function pageCss(i={}){const t=R(i),e=q(i),a=pageFaces(i),s=pageAccent(t),n=[];if(t.paper!==void 0||t.orientation!==void 0||t.margins!==void 0){const{top:r,right:d,bottom:l,left:f}=e.margins;n.push(`@page { size: ${x(e.width)} ${x(e.height)}; margin: ${x(r)} 0 ${x(l)}; }`,`main { max-width: ${x(e.width)}; padding: 0 ${x(d)} 0 ${x(f)}; }`,`.cover { margin-left: -${x(f)}; margin-right: -${x(d)}; }`)}t.font!==void 0&&t.font!=="sans"&&n.push(`body { font-family: ${a.text}; }`,`h1, h2, h3, h4, h5, h6 { font-family: ${a.heading}; }`,`.toc-title { font-family: ${a.heading}; }`),(t.size!==void 0||t.grid!==void 0)&&n.push(`html { font-size: ${b(e.size)}pt; }`),n.push(`body { line-height: ${"pt"in e.lineHeight?`${b(e.lineHeight.pt)}pt`:b(xe(e)??1)}; }`),n.push(...Ee(e)),e.letterSpacing!==0&&n.push(`body { letter-spacing: ${b(e.letterSpacing)}em; }`),t.textIndent!==void 0&&t.textIndent>0&&n.push(`.sources { --hang: ${b(t.textIndent)}em; }`,`p { text-indent: ${b(t.textIndent)}em; }`,"blockquote p, .callout p, .notes p, .toc p { text-indent: 0; }"),t.textAlign==="justify"&&n.push("p, li { text-align: justify; }");const o=J(X,t.title,e.title);o!==void 0&&n.push(o);for(const r of[1,2,3,4,5,6]){const d=J(r===1?"h1, .toc-title":`h${String(r)}`,t.headings?.[r],e.headings[r]);d!==void 0&&n.push(d)}return s!==void 0&&n.push(`a { color: ${s}; text-decoration-color: color-mix(in oklab, ${s} 45%, transparent); }`,`blockquote { --quote-rule: 2px; border-left-color: ${s}; }`),n.join(`
113
- `)}export function docParts(i){const t=[];let e=[],a=!1;for(const s of i)s.type==="pagebreak"&&s.orientation!==void 0?(t.push({blocks:e,landscape:a}),e=[],a=s.orientation==="landscape"):e.push(s);return t.push({blocks:e,landscape:a}),t}export const EMOJI_PATTERN="\\p{RI}\\p{RI}|[#*0-9]\\uFE0F?\\u20E3|(?:\\p{Emoji_Presentation}|\\p{Extended_Pictographic}\\uFE0F)\\p{EMod}?(?:\\u200D(?:\\p{Emoji_Presentation}|\\p{Extended_Pictographic}\\uFE0F?)\\p{EMod}?)*";const ze=`<script>
115
+ `;function je(i,n,e){const a=[...q(i)].filter(o=>o.type==="note");return a.length===0?"":`<section class="notes"><ol>${a.map(o=>({note:o,n:e.notes.get(o.label.toLowerCase())})).sort((o,r)=>(o.n??1/0)-(r.n??1/0)).map(({note:o,n:r})=>`<li${h(o,e)}${r===void 0?"":` id="note-${String(r)}" value="${String(r)}"`}><p>${w(o.content,e)}</p>${y(o.children??[],n,e)}</li>`).join("")}</ol></section>`}const Q="body > h1:first-child, main > h1:first-child, article > h1:first-child, main > .cover + h1",x=i=>`${String(Math.round(i*100)/100)}mm`,$=i=>String(Math.round(i*1e3)/1e3);function Me(i){const n=i.spacing,e=o=>`${$(o)}pt`,a=e(n.after),s=e(n.step),t="pt"in i.lineHeight?e(i.lineHeight.pt):$(i.lineHeight.multiple*(_.mono??1));return[`p, ul, ol, blockquote, pre, table, figure, .math, .callout, .card, .stats, .embed, .sources li { margin: 0 0 ${a}; }`,`h1, h2, h3, h4, h5, h6 { margin: ${e(n.heading.before)} 0 ${e(n.heading.after)}; }`,`.toc-title { margin: ${e(n.heading.before)} 0 ${e(n.heading.after)}; }`,`${Q} { margin-top: 0; margin-bottom: ${e(n.title)}; }`,`ul, ol { padding-left: ${s}; } li ul, li ol { margin-bottom: 0; } li.task { margin-left: -${s}; } .under { margin-left: ${s}; }`,`:is(ul, ol) + :is(ul, ol) { margin-top: -${a}; }`,`blockquote { padding-left: calc(${e(n.quote)} - var(--quote-rule, 1px)); }`,`pre { padding: ${e(n.box.top)} ${e(n.box.side)}; font-size: ${e(n.small)}; line-height: ${t}; } pre code { font-size: inherit; }`,`.callout { padding: ${e(n.box.top)} ${e(n.box.side)} ${e(Math.max(n.box.top-n.after,0))}; }`,`.card { padding: ${e(n.card.top)} ${e(n.card.side)} ${e(Math.max(n.card.top-n.after,0))}; } .card-head { margin-bottom: ${a}; } .card-subtitle { font-size: ${e(n.small)}; }`,`.stats { gap: ${e(n.gap)}; } .stat { padding: ${e(n.card.top)} ${e(n.card.side)}; } .stat-label, .stat-foot { font-size: ${e(n.small)}; } .stat-value { font-size: ${e(n.figure)}; line-height: ${$(_[i.font]??_.sans??1.22)}; }`,`table { font-size: ${e(n.small)}; } th, td { padding: ${e(n.cell.top)} ${e(n.cell.side)}; }`,`caption { font-size: ${e(n.small)}; padding-bottom: ${e(n.caption)}; }`,`figcaption { font-size: ${e(n.small)}; margin-top: ${e(n.caption)}; }`,`hr { height: 1pt; margin: ${e(n.divider)} 0; }`,`.toc ol { margin: 0; } .toc li { margin: 0 0 ${e(n.contents)}; } .sources ol { margin: 0; }`]}function V(i,n,e){if(n===void 0)return;const a=[n.font===void 0?"":`font-family: ${PAGE_FACES[e.font]};`,n.size===void 0?"":`font-size: ${$(e.size)}pt;`,e.font==="xiaobiaosong"?"font-weight: 700;":n.weight===void 0?"":`font-weight: ${e.weight==="bold"?"700":"400"};`,n.align===void 0?"":`text-align: ${e.align};`,n.italic===void 0?"":`font-style: ${e.italic?"italic":"normal"};`,e.rule?`border-bottom: 0.5pt solid ${c.rule}; padding-bottom: ${$(HEADING_RULE_SPACE)}pt;`:""].join(" ");return a.trim()===""?void 0:`${i} { ${a.trim()} }`}export const HEADING_RULE_SPACE=3;export function pageCss(i={}){const n=I(i),e=j(i),a=pageFaces(i),s=pageAccent(n),t=[];if(n.paper!==void 0||n.orientation!==void 0||n.margins!==void 0){const{top:r,right:d,bottom:l,left:f}=e.margins;t.push(`@page { size: ${x(e.width)} ${x(e.height)}; margin: ${x(r)} 0 ${x(l)}; }`,`main { max-width: ${x(e.width)}; padding: 0 ${x(d)} 0 ${x(f)}; }`,`.cover { margin-left: -${x(f)}; margin-right: -${x(d)}; }`)}n.font!==void 0&&n.font!=="sans"&&t.push(`body { font-family: ${a.text}; }`,`h1, h2, h3, h4, h5, h6 { font-family: ${a.heading}; }`,`.toc-title { font-family: ${a.heading}; }`),(n.size!==void 0||n.grid!==void 0)&&t.push(`html { font-size: ${$(e.size)}pt; }`),t.push(`body { line-height: ${"pt"in e.lineHeight?`${$(e.lineHeight.pt)}pt`:$(Ce(e)??1)}; }`),t.push(...Me(e)),e.letterSpacing!==0&&t.push(`body { letter-spacing: ${$(e.letterSpacing)}em; }`),n.textIndent!==void 0&&n.textIndent>0&&t.push(`.sources { --hang: ${$(n.textIndent)}em; }`,`p { text-indent: ${$(n.textIndent)}em; }`,"blockquote p, .callout p, .notes p, .toc p { text-indent: 0; }"),n.textAlign==="justify"&&t.push("p, li { text-align: justify; }");const o=V(Q,n.title,e.title);o!==void 0&&t.push(o);for(const r of[1,2,3,4,5,6]){const d=V(r===1?"h1, .toc-title":`h${String(r)}`,n.headings?.[r],e.headings[r]);d!==void 0&&t.push(d)}return s!==void 0&&t.push(`a { color: ${s}; text-decoration-color: color-mix(in oklab, ${s} 45%, transparent); }`,`blockquote { --quote-rule: 2px; border-left-color: ${s}; }`),t.join(`
116
+ `)}export function docParts(i){const n=[];let e=[],a=!1;for(const s of i)s.type==="pagebreak"&&s.orientation!==void 0?(n.push({blocks:e,landscape:a}),e=[],a=s.orientation==="landscape"):e.push(s);return n.push({blocks:e,landscape:a}),n}export const EMOJI_PATTERN="\\p{RI}\\p{RI}|[#*0-9]\\uFE0F?\\u20E3|(?:\\p{Emoji_Presentation}|\\p{Extended_Pictographic}\\uFE0F)\\p{EMod}?(?:\\u200D(?:\\p{Emoji_Presentation}|\\p{Extended_Pictographic}\\uFE0F?)\\p{EMod}?)*";const Ae=`<script>
114
117
  window.allyhubReady = (async () => {
115
118
  const pattern = new RegExp(${JSON.stringify(EMOJI_PATTERN)}, "gu");
116
119
  const walker = document.createTreeWalker(document.querySelector("main"), NodeFilter.SHOW_TEXT);
@@ -154,7 +157,7 @@ window.allyhubReady = (async () => {
154
157
  }
155
158
  await Promise.all([...document.querySelectorAll("img.emoji")].map((i) => i.decode().catch(() => undefined)));
156
159
  })();
157
- <\/script>`,Ne=`<script>
160
+ <\/script>`,Re=`<script>
158
161
  window.allyhubReady = (async (before) => {
159
162
  await before;
160
163
  await document.fonts.ready;
@@ -170,7 +173,7 @@ window.allyhubReady = (async (before) => {
170
173
  if (el.matches("p") || el.children.length === el.querySelectorAll(":scope > .words, :scope > .box").length)
171
174
  if (lines(el) < 4) el.style.breakInside = "avoid";
172
175
  })(window.allyhubReady);
173
- <\/script>`,Te=`<script>
176
+ <\/script>`,qe=`<script>
174
177
  window.allyhubReady = (async (before) => {
175
178
  await before;
176
179
  await document.fonts.ready;
@@ -255,24 +258,24 @@ window.allyhubReady = (async (before) => {
255
258
  }
256
259
  }
257
260
  })(window.allyhubReady);
258
- <\/script>`;export function docHtml(i,t={}){const e=headingAnchors(i),a=re(i,t.page),{title:s}=he(i),n=new Map,o=[];for(const h of A(i)){const m=se(h),$=a.get(h);if(m!==void 0&&$!==void 0&&n.set(m,$.label),h.type==="heading"){const w=e.get(h)??"";n.set(w,h.content.map(j=>j.text).join("")),h!==s&&o.push({block:h,anchor:w})}}const r={embeds:0,notes:$e(i),anchors:e,ids:t.ids?blockNumbers(i):void 0,numbers:a,refs:n,headings:o,headingPage:t.headingPage,chinese:le(i),sources:(()=>{const h=R(t.page??{}).citationStyle??"apa",m=t.sources??[],$=ae(i,m,h);return{items:m,style:h,numbers:new Map($.map(w=>[w.item.id,w.n])),list:$}})(),listed:!1},d=docParts(i),l=t.part,f=l===void 0?void 0:d[l],u=f===void 0?d.flatMap(h=>h.blocks):f.blocks,S=l===void 0||l===0,N=l===void 0||l===d.length-1,v=S?t.page?.cover:void 0,E=v===void 0?void 0:t.image?.(v)??v,H=`${E===void 0?"":`<figure class="cover"><img src="${c(E)}" alt="" style="object-position:50% ${String(t.page?.coverY??50)}%"></figure>
259
- `}${y(u,t,r)}${N&&!r.listed?K(r):""}${N?Ce(i,t,r):""}`,z=q(t.page),T=[pageCss(t.page),...f?.landscape===!0?[`@page { size: ${x(z.height)} ${x(z.width)}; }`,`main { max-width: ${x(z.height)}; }`]:[],...E===void 0?[]:["@page :first { margin-top: 0; }"]].filter(h=>h!=="").join(`
261
+ <\/script>`;export function docHtml(i,n={}){const e=headingAnchors(i),a=pe(i,n.page),{title:s}=xe(i),t=new Map,o=[];for(const u of q(i)){const S=ce(u),v=a.get(u);if(S!==void 0&&v!==void 0&&t.set(S,v.label),u.type==="heading"){const m=e.get(u)??"";t.set(m,u.content.map(b=>b.text).join("")),u!==s&&o.push({block:u,anchor:m})}}const r={embeds:0,notes:Se(i),anchors:e,ids:n.ids?blockNumbers(i):void 0,numbers:a,refs:t,headings:o,headingPage:n.headingPage,chinese:he(i),sources:(()=>{const u=I(n.page??{}).citationStyle??"apa",S=n.sources??[],v=le(i,S,u);return{items:S,style:u,numbers:new Map(v.map(m=>[m.item.id,m.n])),list:v}})(),listed:!1},d=docParts(i),l=n.part,f=l===void 0?void 0:d[l],g=f===void 0?d.flatMap(u=>u.blocks):f.blocks,k=l===void 0||l===0,M=l===void 0||l===d.length-1,C=k?n.page?.cover:void 0,E=C===void 0?void 0:n.image?.(C)??C,O=`${E===void 0?"":`<figure class="cover"><img src="${p(E)}" alt="" style="object-position:50% ${String(n.page?.coverY??50)}%"></figure>
262
+ `}${y(g,n,r)}${M&&!r.listed?Y(r):""}${M?je(i,n,r):""}`,z=j(n.page),A=[pageCss(n.page),...f?.landscape===!0?[`@page { size: ${x(z.height)} ${x(z.width)}; }`,`main { max-width: ${x(z.height)}; }`]:[],...E===void 0?[]:["@page :first { margin-top: 0; }"]].filter(u=>u!=="").join(`
260
263
  `);return`<!doctype html>
261
264
  <html>
262
265
  <head>
263
266
  <meta charset="utf-8">
264
- <title>${c(t.title??"")}</title>
265
- ${t.fonts===void 0?"":`<style>${t.fonts}</style>
266
- `}<style>${DOC_CSS}${T===""?"":`
267
- ${T}`}</style>
267
+ <title>${p(n.title??"")}</title>
268
+ ${n.fonts===void 0?"":`<style>${n.fonts}</style>
269
+ `}<style>${DOC_CSS}${A===""?"":`
270
+ ${A}`}</style>
268
271
  </head>
269
272
  <body>
270
273
  <main>
271
- ${H}
274
+ ${O}
272
275
  </main>
273
- ${ze}
274
- ${R(t.page??{}).grid===void 0?"":Te}
275
- ${Ne}
276
+ ${Ae}
277
+ ${I(n.page??{}).grid===void 0?"":qe}
278
+ ${Re}
276
279
  </body>
277
280
  </html>
278
281
  `}
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- export function statTone(e){const t=e.delta?.trim().charAt(0),r=t==="+"||t==="↑";return!r&&!(t==="-"||t==="−"||t==="–"||t==="↓")?"flat":r!==(e.downIsGood===!0)?"good":"bad"}export const CHART_LABELS=["value","percentage","category","series"];export{PAGE_FONTS}from"./page.js";export const COVER_HEIGHT_MM=64,COVER_ASPECT=COVER_HEIGHT_MM/210,hasText=e=>"content"in e;const h=["bold","italic","underline","strike"],g=(e,t)=>e.note===void 0&&t.note===void 0&&e.cite===void 0&&t.cite===void 0&&e.href===t.href&&JSON.stringify(d(e.styles))===JSON.stringify(d(t.styles));export function plainEdges(e){const t=[],r=(n,o,c)=>{if(n==="")return;const s={text:n,styles:o,...c===void 0?{}:{href:c}},f=t.at(-1);f&&g(f,s)?f.text+=n:t.push(s)};return e.forEach((n,o)=>{if(n.note!==void 0||n.cite!==void 0||n.text===""&&n.href!==void 0){t.push({...n});return}const{styles:c,href:s}=n,f=!c.code&&s===void 0&&h.some(x=>c[x])?/^(\s*)([\s\S]*?)(\s*)$/u.exec(n.text):null;if(!f){r(n.text,c,s);return}const[,u="",l="",p=""]=f,i={...c};delete i.bold,delete i.italic,delete i.underline,delete i.strike;const y=e[o-1]?.note!==void 0,a=e[o+1]?.note!==void 0;r(u,y?c:i,s),r(l,l===""?i:c,s),r(p,a?c:i,s)}),t}const m=e=>e.length>0&&e.every(t=>t!==null&&typeof t=="object"&&typeof t.text=="string"&&typeof t.styles=="object");function d(e){if(Array.isArray(e))return(m(e)?plainEdges(e):e).map(d);if(e!==null&&typeof e=="object"){const t={};for(const r of Object.keys(e).sort()){const n=e[r];n!==void 0&&(t[r]=d(n))}return t}return e}export const blockKey=e=>JSON.stringify(d(e)),sameBlocks=(e,t)=>e.length===t.length&&e.every((r,n)=>{const o=t[n];return o!==void 0&&blockKey(r)===blockKey(o)}),innerBlocks=e=>e.type==="columns"?e.columns.flatMap(t=>t.blocks):"children"in e?e.children??[]:[];export function*everyBlock(e){for(const t of e)yield t,yield*everyBlock(innerBlocks(t))}export function noteNumbers(e){const t=new Map,r=new Set([...everyBlock(e)].flatMap(o=>o.type==="note"?[o.label.toLowerCase()]:[])),n=o=>{for(const c of o){const s=c.note?.toLowerCase();s!==void 0&&r.has(s)&&!t.has(s)&&t.set(s,t.size+1)}};for(const o of everyBlock(e))if(o.type!=="note"&&("content"in o&&n(o.content),o.type==="table"))for(const c of o.rows)for(const s of c)n(s);return t}export const shownBlocks=e=>e.filter(t=>t.type!=="source");
2
+ export function statTone(e){const t=e.delta?.trim().charAt(0),s=t==="+"||t==="↑";return!s&&!(t==="-"||t==="−"||t==="–"||t==="↓")?"flat":s!==(e.downIsGood===!0)?"good":"bad"}export const CHART_LABELS=["value","percentage","category","series"];export{PAGE_FONTS}from"./page.js";export const COVER_HEIGHT_MM=64,COVER_ASPECT=COVER_HEIGHT_MM/210,hasText=e=>"content"in e;const g=["bold","italic","underline","strike"],m=(e,t)=>e.note===void 0&&t.note===void 0&&e.cite===void 0&&t.cite===void 0&&e.href===t.href&&JSON.stringify(d(e.styles))===JSON.stringify(d(t.styles));export function plainEdges(e){const t=[],s=(o,i,n)=>{if(o==="")return;const r={text:o,styles:i,...n===void 0?{}:{href:n}},c=t.at(-1);c&&m(c,r)?c.text+=o:t.push(r)};return e.forEach((o,i)=>{if(o.note!==void 0||o.cite!==void 0||o.text===""&&o.href!==void 0){t.push({...o});return}const{styles:n,href:r}=o,c=!n.code&&r===void 0&&g.some(h=>n[h])?/^(\s*)([\s\S]*?)(\s*)$/u.exec(o.text):null;if(!c){s(o.text,n,r);return}const[,p="",l="",a=""]=c,f={...n};delete f.bold,delete f.italic,delete f.underline,delete f.strike;const y=e[i-1]?.note!==void 0,x=e[i+1]?.note!==void 0;s(p,y?n:f,r),s(l,l===""?f:n,r),s(a,x?n:f,r)}),t}const k=e=>e.length>0&&e.every(t=>t!==null&&typeof t=="object"&&typeof t.text=="string"&&typeof t.styles=="object");function d(e){if(Array.isArray(e))return(k(e)?plainEdges(e):e).map(d);if(e!==null&&typeof e=="object"){const t={};for(const s of Object.keys(e).sort()){const o=e[s];o!==void 0&&(t[s]=d(o))}return t}return e}export const blockKey=e=>JSON.stringify(d(e)),sameBlocks=(e,t)=>e.length===t.length&&e.every((s,o)=>{const i=t[o];return i!==void 0&&blockKey(s)===blockKey(i)}),innerBlocks=e=>e.type==="columns"?e.columns.flatMap(t=>t.blocks):"children"in e?e.children??[]:[];export function*everyBlock(e){for(const t of e)yield t,yield*everyBlock(innerBlocks(t))}export function noteNumbers(e){return u(e).numbers}export function firstNoteMarks(e){return u(e).first}function u(e){const t=new Map,s=new Set,o=new Set([...everyBlock(e)].flatMap(n=>n.type==="note"?[n.label.toLowerCase()]:[])),i=n=>{for(const r of n){const c=r.note?.toLowerCase();c!==void 0&&o.has(c)&&!t.has(c)&&(t.set(c,t.size+1),s.add(r))}};for(const n of everyBlock(e))if(n.type!=="note"&&("content"in n&&i(n.content),n.type==="table"))for(const r of n.rows)for(const c of r)i(c);return{numbers:t,first:s}}export const shownBlocks=e=>e.filter(t=>t.type!=="source");
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{CITATION_STYLES as $}from"./cite.js";export const PAPERS={a3:[297,420],a4:[210,297],a5:[148,210],b5:[176,250],letter:[215.9,279.4],legal:[215.9,355.6]},PAGE_FONTS=["sans","serif","mono","times","song","hei","fangsong","kai","xiaobiaosong"],CHINESE_SIZES={初号:42,小初:36,一号:26,小一:24,二号:22,小二:18,三号:16,小三:15,四号:14,小四:12,五号:10.5,小五:9,六号:7.5,小六:6.5,七号:5.5,八号:5},RUNNING_PLACES=["left","center","right","outside","inside"],PAGE_PRESETS=["apa","mla","report"];const x={apa:{paper:"letter",margins:25.4,font:"times",size:12,lineHeight:2,textIndent:3,paragraphSpacing:0,textAlign:"left",title:{size:12,weight:"bold",align:"center"},headings:{1:{size:12,weight:"bold",align:"center"},2:{size:12,weight:"bold"},3:{size:12,weight:"bold",italic:!0},4:{size:12,weight:"bold"},5:{size:12,weight:"bold",italic:!0},6:{size:12,weight:"bold"}},header:{right:"{page}"},footer:!1,citationStyle:"apa"},mla:{paper:"letter",margins:25.4,font:"times",size:12,lineHeight:2,textIndent:3,paragraphSpacing:0,textAlign:"left",title:{size:12,weight:"normal",align:"center"},headings:{1:{size:12,weight:"bold"},2:{size:12,weight:"bold"},3:{size:12,weight:"bold",italic:!0},4:{size:12,weight:"bold"},5:{size:12,weight:"bold"},6:{size:12,weight:"bold"}},header:{right:"{page}"},footer:!1,citationStyle:"mla"},report:{size:10.5,lineHeight:1.2,paragraphSpacing:.7,title:{size:24,weight:"bold"},headings:{1:{size:18,weight:"bold"},2:{size:14,weight:"bold",rule:!0},3:{size:11.5,weight:"bold"}}}};export const presetLook=e=>x[e];export function effectiveLook(e){if(e.preset===void 0)return e;const i=x[e.preset],n={...i.headings};for(const[a,t]of Object.entries(e.headings??{}))n[Number(a)]={...i.headings?.[Number(a)],...t};return{...i,...e,...i.title||e.title?{title:{...i.title,...e.title}}:{},...Object.keys(n).length>0?{headings:n}:{}}}export const sizePt=e=>typeof e=="number"?e:CHINESE_SIZES[e];export function marginBox(e){return typeof e=="number"?{top:e,right:e,bottom:e,left:e}:e.length===2?{top:e[0],right:e[1],bottom:e[0],left:e[1]}:{top:e[0],right:e[1],bottom:e[2],left:e[3]}}export const PAGE_DEFAULTS={paper:"letter",margins:{top:18,right:20,bottom:18,left:20},size:11,lineHeight:1.15,textIndent:0,paragraphSpacing:.5,headingScale:{title:2.3,1:1.75,2:1.45,3:1.15,4:1,5:1,6:1},footer:{left:"{title}",right:"{page} / {pages}"}};const N=25.4/72;export const paperSize=e=>e===void 0?PAPERS[PAGE_DEFAULTS.paper]:typeof e=="string"?PAPERS[e]:e;export function resolvePage(e={}){const i=effectiveLook(e),[n,a]=paperSize(i.paper),t=i.orientation==="landscape",s=t?Math.max(n,a):Math.min(n,a),r=t?Math.min(n,a):Math.max(n,a),o=i.margins===void 0?{...PAGE_DEFAULTS.margins}:marginBox(i.margins),g=s-o.left-o.right,p=r-o.top-o.bottom,y=i.font??"sans";let c=i.size===void 0?PAGE_DEFAULTS.size:sizePt(i.size),u=i.lineHeight===void 0?{multiple:PAGE_DEFAULTS.lineHeight}:typeof i.lineHeight=="number"?{multiple:i.lineHeight}:{pt:Number.parseFloat(i.lineHeight)},S=0;if(i.grid){u={pt:p/N/i.grid.lines};const f=g/N/i.grid.chars;i.size===void 0&&(c=Math.floor(f*2)/2),S=(f*.998-c)/c}const m=(f,I)=>({font:f?.font??y,size:f?.size===void 0?c*I:sizePt(f.size),weight:f?.weight??"bold",align:f?.align??"left",italic:f?.italic??!1,rule:f?.rule??!1}),z=PAGE_DEFAULTS.headingScale,A=Object.fromEntries([1,2,3,4,5,6].map(f=>[f,m(i.headings?.[f],z[f])])),E=i.footer===!1||i.footer===void 0&&i.pageNumbers===!1?void 0:i.footer??PAGE_DEFAULTS.footer;return{width:s,height:r,margins:o,textWidth:g,textHeight:p,font:y,size:c,lineHeight:u,letterSpacing:S,textIndent:i.textIndent??PAGE_DEFAULTS.textIndent,paragraphSpacing:i.paragraphSpacing??PAGE_DEFAULTS.paragraphSpacing,textAlign:i.textAlign??"left",title:m(i.title,z.title),headings:A,header:i.header===!1?void 0:i.header,footer:E,captions:i.captions==="numbered",spacing:H(c,i.paragraphSpacing??PAGE_DEFAULTS.paragraphSpacing,i.grid===void 0||!("pt"in u)?void 0:u.pt)}}export const LIST_STEP=18;function H(e,i,n){const a=n!==void 0||i===0;return{after:i*e,heading:a?{before:0,after:0}:{before:14,after:6},title:n??(a?0:12),caption:4,box:{top:6,side:8},cell:{top:4,side:7},divider:12,contents:5,quote:12,step:LIST_STEP,small:Math.round(e*.9*2)/2,card:{top:9,side:11},gap:8,figure:Math.round(e*2.2)}}export const SINGLE_LINE={sans:1.2207,serif:1.1719,mono:1.1328,times:1.1499},lineMultiple=e=>"pt"in e.lineHeight?void 0:e.lineHeight.multiple*(SINGLE_LINE[e.font]??1),lineHeightPt=(e,i=e.size)=>"pt"in e.lineHeight?e.lineHeight.pt:(lineMultiple(e)??1)*i,PAGE_KEYS=["preset","paper","orientation","margins","font","size","line-height","text-indent","paragraph-spacing","text-align","grid","title","headings","header","footer","captions","bibliography","citation-style","accent","cover","cover-y","page-numbers","picture-dpi"];const J=["left","center","right"],d=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),l=e=>typeof e=="number"&&Number.isFinite(e)&&e>0;function h(e){if(l(e))return e;if(typeof e=="string"){const i=e.trim();if(Object.hasOwn(CHINESE_SIZES,i))return i;const n=/^(\d+(?:\.\d+)?)\s*pt$/u.exec(i);if(n)return Number(n[1])}}const b=`a size in pt (12) or a Chinese size (${Object.keys(CHINESE_SIZES).join(", ")})`;function O(e,i,n){if(!d(e)){n(`${i} holds font, size, weight, align, italic and rule`);return}const a={};for(const[t,s]of Object.entries(e))if(t==="font")PAGE_FONTS.includes(s)?a.font=s:n(`${i}'s font is ${PAGE_FONTS.join(", ")}, not ${JSON.stringify(s)}`);else if(t==="size"){const r=h(s);r===void 0?n(`${i}'s size is ${b}`):a.size=r}else t==="weight"?s==="normal"||s==="bold"?a.weight=s:n(`${i}'s weight is normal or bold, not ${JSON.stringify(s)}`):t==="align"?J.includes(s)?a.align=s:n(`${i}'s align is left, center or right, not ${JSON.stringify(s)}`):t==="italic"?typeof s=="boolean"?a.italic=s:n(`${i}'s italic is true or false, not ${JSON.stringify(s)}`):t==="rule"?typeof s=="boolean"?a.rule=s:n(`${i}'s rule is true or false, not ${JSON.stringify(s)}`):n(`${i} holds font, size, weight, align, italic and rule: ${t} is not one of them`);return a}function P(e,i,n){if(e===!1)return!1;if(typeof e=="string")return{center:e};if(!d(e)){n(`a page's ${i} is false, words, or words by place (${RUNNING_PLACES.join(", ")}) with a font and a size`);return}const a={};for(const[t,s]of Object.entries(e))if(t==="font")PAGE_FONTS.includes(s)?a.font=s:n(`a page's ${i} font is ${PAGE_FONTS.join(", ")}, not ${JSON.stringify(s)}`);else if(t==="size"){const r=h(s);r===void 0?n(`a page's ${i} size is ${b}`):a.size=r}else RUNNING_PLACES.includes(t)?typeof s!="string"&&typeof s!="number"?n(`a page's ${i} ${t} is words`):a[t]=String(s):n(`a page's ${i} holds ${RUNNING_PLACES.join(", ")}, font and size: ${t} is not one of them`);return a}export function readPageLook(e,i){const n={};for(const[a,t]of Object.entries(e))switch(a){case"preset":PAGE_PRESETS.includes(t)?n.preset=t:i(`a page's preset is ${PAGE_PRESETS.join(" or ")}, not ${JSON.stringify(t)}`);break;case"paper":{const s=typeof t=="string"?t.trim().toLowerCase():void 0;s!==void 0&&Object.hasOwn(PAPERS,s)?n.paper=s:Array.isArray(t)&&t.length===2&&t.every(l)?n.paper=t:i(`a page's paper is ${Object.keys(PAPERS).join(", ")} or its width and height in mm ([210, 297]), not ${JSON.stringify(t)}`);break}case"orientation":t==="portrait"||t==="landscape"?n.orientation=t:i(`a page's orientation is portrait or landscape, not ${JSON.stringify(t)}`);break;case"margins":typeof t=="number"&&t>=0||Array.isArray(t)&&(t.length===2||t.length===4)&&t.every(s=>typeof s=="number"&&s>=0)?n.margins=t:i("a page's margins are mm: one for all four, [top and bottom, sides], or [top, right, bottom, left]");break;case"font":PAGE_FONTS.includes(t)?n.font=t:i(`a page's font is ${PAGE_FONTS.join(", ")}, not ${JSON.stringify(t)}`);break;case"size":{const s=h(t);s===void 0?i(`a page's size is ${b}`):n.size=s;break}case"line-height":l(t)?n.lineHeight=t:typeof t=="string"&&/^\d+(\.\d+)?pt$/u.test(t.trim())?n.lineHeight=t.trim():i(`a page's line-height is a multiple (1.5) or pt (28pt), not ${JSON.stringify(t)}`);break;case"text-indent":typeof t=="number"&&t>=0?n.textIndent=t:i("a page's text-indent is how many characters a paragraph's first line is set in (2)");break;case"paragraph-spacing":typeof t=="number"&&t>=0?n.paragraphSpacing=t:i("a page's paragraph-spacing is the space between paragraphs in em (0.5)");break;case"text-align":t==="left"||t==="justify"?n.textAlign=t:i(`a page's text-align is left or justify, not ${JSON.stringify(t)}`);break;case"grid":{const s=d(t)?t.chars:void 0,r=d(t)?t.lines:void 0;d(t)&&Object.keys(t).length===2&&l(s)&&l(r)&&Number.isInteger(s)&&Number.isInteger(r)?n.grid={chars:s,lines:r}:i("a page's grid is { chars, lines }: characters to a line and lines to a page");break}case"title":{const s=O(t,"the title",i);s&&(n.title=s);break}case"headings":{if(!d(t)){i("a page's headings are by level: { 1: { font, size }, 2: … }");break}const s={};for(const[r,o]of Object.entries(t)){const g=Number(r);if(!Number.isInteger(g)||g<1||g>6){i(`a heading's level is 1 to 6, not ${r}`);continue}const p=O(o,`heading ${r}`,i);p&&(s[g]=p)}n.headings=s;break}case"header":case"footer":{const s=P(t,a,i);s!==void 0&&(n[a]=s);break}case"captions":t==="numbered"?n.captions="numbered":t!=="plain"&&i(`a page's captions are numbered or plain, not ${JSON.stringify(t)}`);break;case"bibliography":typeof t=="string"&&t.trim()!==""?n.bibliography=t.trim():i("a page's bibliography is a CSL-JSON file's path");break;case"citation-style":$.includes(t)?n.citationStyle=t:i(`a page's citation-style is ${$.join(" or ")}, not ${JSON.stringify(t)}`);break;case"accent":typeof t=="string"&&t.trim()!==""?n.accent=t.trim():i("a page's accent is a colour");break;case"cover":typeof t=="string"&&t.trim()!==""?n.cover=t.trim():i("a page's cover is a picture's path");break;case"cover-y":typeof t=="number"&&t>=0&&t<=100?n.coverY=t:i(`a cover's cover-y is 0 (its top) to 100 (its bottom), not ${JSON.stringify(t)}`);break;case"picture-dpi":t===!1?n.pictureDpi=!1:typeof t=="number"&&t>=72&&t<=2400?n.pictureDpi=t:i(`a page's picture-dpi is 72 to 2400 (dots an inch of paper), or false to print pictures as they are, not ${JSON.stringify(t)}`);break;case"page-numbers":t===!1?n.pageNumbers=!1:t!==!0&&i(`a page's page-numbers is true or false, not ${JSON.stringify(t)}`);break;default:i(`the front matter holds ${PAGE_KEYS.join(", ")}: ${a} is not one of them`)}return n}const w=e=>({...e.font===void 0?{}:{font:e.font},...e.size===void 0?{}:{size:e.size},...e.weight===void 0?{}:{weight:e.weight},...e.align===void 0?{}:{align:e.align},...e.italic===void 0?{}:{italic:e.italic},...e.rule===void 0?{}:{rule:e.rule}}),j=e=>e===!1?!1:Object.keys(e).length===1&&e.center!==void 0?e.center:{...e},v=e=>/^[ab]\d$/u.test(e)?e.toUpperCase():`${e.charAt(0).toUpperCase()}${e.slice(1)}`;export function pageLookYaml(e){return{...e.preset===void 0?{}:{preset:e.preset},...e.paper===void 0?{}:{paper:typeof e.paper=="string"?v(e.paper):[...e.paper]},...e.orientation===void 0?{}:{orientation:e.orientation},...e.margins===void 0?{}:{margins:typeof e.margins=="number"?e.margins:[...e.margins]},...e.font===void 0?{}:{font:e.font},...e.size===void 0?{}:{size:e.size},...e.lineHeight===void 0?{}:{"line-height":e.lineHeight},...e.textIndent===void 0?{}:{"text-indent":e.textIndent},...e.paragraphSpacing===void 0?{}:{"paragraph-spacing":e.paragraphSpacing},...e.textAlign===void 0?{}:{"text-align":e.textAlign},...e.grid===void 0?{}:{grid:{...e.grid}},...e.title===void 0?{}:{title:w(e.title)},...e.headings===void 0?{}:{headings:Object.fromEntries(Object.entries(e.headings).map(([n,a])=>[n,w(a)]))},...e.header===void 0?{}:{header:j(e.header)},...e.footer===void 0?{}:{footer:j(e.footer)},...e.captions===void 0?{}:{captions:e.captions},...e.bibliography===void 0?{}:{bibliography:e.bibliography},...e.citationStyle===void 0?{}:{"citation-style":e.citationStyle},...e.accent===void 0?{}:{accent:e.accent},...e.cover===void 0?{}:{cover:e.cover},...e.cover===void 0||e.coverY===void 0?{}:{"cover-y":e.coverY},...e.pageNumbers===!1?{"page-numbers":!1}:{},...e.pictureDpi===void 0?{}:{"picture-dpi":e.pictureDpi}}}
2
+ import{CITATION_STYLES as x}from"./cite.js";export const PAPERS={a3:[297,420],a4:[210,297],a5:[148,210],b5:[176,250],letter:[215.9,279.4],legal:[215.9,355.6]},PAGE_FONTS=["sans","serif","mono","times","song","hei","fangsong","kai","xiaobiaosong"],CHINESE_SIZES={初号:42,小初:36,一号:26,小一:24,二号:22,小二:18,三号:16,小三:15,四号:14,小四:12,五号:10.5,小五:9,六号:7.5,小六:6.5,七号:5.5,八号:5},RUNNING_PLACES=["left","center","right","outside","inside"],PAGE_PRESETS=["apa","mla","report","memo","business-letter"];const $={apa:{paper:"letter",margins:25.4,font:"times",size:12,lineHeight:2,textIndent:3,paragraphSpacing:0,textAlign:"left",title:{size:12,weight:"bold",align:"center"},headings:{1:{size:12,weight:"bold",align:"center"},2:{size:12,weight:"bold"},3:{size:12,weight:"bold",italic:!0},4:{size:12,weight:"bold"},5:{size:12,weight:"bold",italic:!0},6:{size:12,weight:"bold"}},header:{right:"{page}"},footer:!1,citationStyle:"apa"},mla:{paper:"letter",margins:25.4,font:"times",size:12,lineHeight:2,textIndent:3,paragraphSpacing:0,textAlign:"left",title:{size:12,weight:"normal",align:"center"},headings:{1:{size:12,weight:"bold"},2:{size:12,weight:"bold"},3:{size:12,weight:"bold",italic:!0},4:{size:12,weight:"bold"},5:{size:12,weight:"bold"},6:{size:12,weight:"bold"}},header:{right:"{page}"},footer:!1,citationStyle:"mla"},report:{size:10.5,lineHeight:1.2,paragraphSpacing:.7,title:{size:24,weight:"bold"},headings:{1:{size:18,weight:"bold"},2:{size:14,weight:"bold",rule:!0},3:{size:11.5,weight:"bold"}}},memo:{paper:"letter",margins:25.4,font:"times",size:12,lineHeight:1,textIndent:0,paragraphSpacing:1,textAlign:"left",title:{size:12,weight:"bold"},headings:{1:{size:12,weight:"bold"},2:{size:12,weight:"bold"},3:{size:12,weight:"bold",italic:!0},4:{size:12,weight:"bold"},5:{size:12,weight:"bold"},6:{size:12,weight:"bold"}},header:!1,footer:{center:"{page}"}},"business-letter":{paper:"letter",margins:25.4,font:"times",size:12,lineHeight:1,textIndent:0,paragraphSpacing:1,textAlign:"left",title:{size:12,weight:"bold"},headings:{1:{size:12,weight:"bold"},2:{size:12,weight:"bold"},3:{size:12,weight:"bold"},4:{size:12,weight:"bold"},5:{size:12,weight:"bold"},6:{size:12,weight:"bold"}},header:!1,footer:!1,pageNumbers:!1}};export const presetLook=e=>$[e];export function effectiveLook(e){if(e.preset===void 0)return e;const i=$[e.preset],n={...i.headings};for(const[a,t]of Object.entries(e.headings??{}))n[Number(a)]={...i.headings?.[Number(a)],...t};return{...i,...e,...i.title||e.title?{title:{...i.title,...e.title}}:{},...Object.keys(n).length>0?{headings:n}:{}}}export const sizePt=e=>typeof e=="number"?e:CHINESE_SIZES[e];export function marginBox(e){return typeof e=="number"?{top:e,right:e,bottom:e,left:e}:e.length===2?{top:e[0],right:e[1],bottom:e[0],left:e[1]}:{top:e[0],right:e[1],bottom:e[2],left:e[3]}}export const PAGE_DEFAULTS={paper:"letter",margins:{top:18,right:20,bottom:18,left:20},size:11,lineHeight:1.15,textIndent:0,paragraphSpacing:.5,headingScale:{title:2.3,1:1.75,2:1.45,3:1.15,4:1,5:1,6:1},footer:{left:"{title}",right:"{page} / {pages}"}};const w=25.4/72;export const paperSize=e=>e===void 0?PAPERS[PAGE_DEFAULTS.paper]:typeof e=="string"?PAPERS[e]:e;export function resolvePage(e={}){const i=effectiveLook(e),[n,a]=paperSize(i.paper),t=i.orientation==="landscape",s=t?Math.max(n,a):Math.min(n,a),r=t?Math.min(n,a):Math.max(n,a),f=i.margins===void 0?{...PAGE_DEFAULTS.margins}:marginBox(i.margins),g=s-f.left-f.right,p=r-f.top-f.bottom,y=i.font??"sans";let d=i.size===void 0?PAGE_DEFAULTS.size:sizePt(i.size),h=i.lineHeight===void 0?{multiple:PAGE_DEFAULTS.lineHeight}:typeof i.lineHeight=="number"?{multiple:i.lineHeight}:{pt:Number.parseFloat(i.lineHeight)},z=0;if(i.grid){h={pt:p/w/i.grid.lines};const o=g/w/i.grid.chars;i.size===void 0&&(d=Math.floor(o*2)/2),z=(o*.998-d)/d}const m=(o,E)=>({font:o?.font??y,size:o?.size===void 0?d*E:sizePt(o.size),weight:o?.weight??"bold",align:o?.align??"left",italic:o?.italic??!1,rule:o?.rule??!1}),S=PAGE_DEFAULTS.headingScale,A=Object.fromEntries([1,2,3,4,5,6].map(o=>[o,m(i.headings?.[o],S[o])])),I=i.footer===!1||i.footer===void 0&&i.pageNumbers===!1?void 0:i.footer??PAGE_DEFAULTS.footer;return{width:s,height:r,margins:f,textWidth:g,textHeight:p,font:y,size:d,lineHeight:h,letterSpacing:z,textIndent:i.textIndent??PAGE_DEFAULTS.textIndent,paragraphSpacing:i.paragraphSpacing??PAGE_DEFAULTS.paragraphSpacing,textAlign:i.textAlign??"left",title:m(i.title,S.title),headings:A,header:i.header===!1?void 0:i.header,footer:I,captions:i.captions!=="plain",spacing:H(d,i.paragraphSpacing??PAGE_DEFAULTS.paragraphSpacing,i.grid===void 0||!("pt"in h)?void 0:h.pt)}}export const LIST_STEP=18;function H(e,i,n){const a=n!==void 0||i===0;return{after:i*e,heading:a?{before:0,after:0}:{before:14,after:6},title:n??(a?0:12),caption:4,box:{top:6,side:8},cell:{top:4,side:7},divider:12,contents:5,quote:12,step:LIST_STEP,small:Math.round(e*.9*2)/2,card:{top:9,side:11},gap:8,figure:Math.round(e*2.2)}}export const SINGLE_LINE={sans:1.2207,serif:1.1719,mono:1.1328,times:1.1499},lineMultiple=e=>"pt"in e.lineHeight?void 0:e.lineHeight.multiple*(SINGLE_LINE[e.font]??1),lineHeightPt=(e,i=e.size)=>"pt"in e.lineHeight?e.lineHeight.pt:(lineMultiple(e)??1)*i,PAGE_KEYS=["preset","paper","orientation","margins","font","size","line-height","text-indent","paragraph-spacing","text-align","grid","title","headings","header","footer","captions","bibliography","citation-style","accent","cover","cover-y","page-numbers","picture-dpi"];const J=["left","center","right"],c=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),l=e=>typeof e=="number"&&Number.isFinite(e)&&e>0;function u(e){if(l(e))return e;if(typeof e=="string"){const i=e.trim();if(Object.hasOwn(CHINESE_SIZES,i))return i;const n=/^(\d+(?:\.\d+)?)\s*pt$/u.exec(i);if(n)return Number(n[1])}}const b=`a size in pt (12) or a Chinese size (${Object.keys(CHINESE_SIZES).join(", ")})`;function N(e,i,n){if(!c(e)){n(`${i} holds font, size, weight, align, italic and rule`);return}const a={};for(const[t,s]of Object.entries(e))if(t==="font")PAGE_FONTS.includes(s)?a.font=s:n(`${i}'s font is ${PAGE_FONTS.join(", ")}, not ${JSON.stringify(s)}`);else if(t==="size"){const r=u(s);r===void 0?n(`${i}'s size is ${b}`):a.size=r}else t==="weight"?s==="normal"||s==="bold"?a.weight=s:n(`${i}'s weight is normal or bold, not ${JSON.stringify(s)}`):t==="align"?J.includes(s)?a.align=s:n(`${i}'s align is left, center or right, not ${JSON.stringify(s)}`):t==="italic"?typeof s=="boolean"?a.italic=s:n(`${i}'s italic is true or false, not ${JSON.stringify(s)}`):t==="rule"?typeof s=="boolean"?a.rule=s:n(`${i}'s rule is true or false, not ${JSON.stringify(s)}`):n(`${i} holds font, size, weight, align, italic and rule: ${t} is not one of them`);return a}function P(e,i,n){if(e===!1)return!1;if(typeof e=="string")return{center:e};if(!c(e)){n(`a page's ${i} is false, words, or words by place (${RUNNING_PLACES.join(", ")}) with a font and a size`);return}const a={};for(const[t,s]of Object.entries(e))if(t==="font")PAGE_FONTS.includes(s)?a.font=s:n(`a page's ${i} font is ${PAGE_FONTS.join(", ")}, not ${JSON.stringify(s)}`);else if(t==="size"){const r=u(s);r===void 0?n(`a page's ${i} size is ${b}`):a.size=r}else RUNNING_PLACES.includes(t)?typeof s!="string"&&typeof s!="number"?n(`a page's ${i} ${t} is words`):a[t]=String(s):n(`a page's ${i} holds ${RUNNING_PLACES.join(", ")}, font and size: ${t} is not one of them`);return a}export function readPageLook(e,i){const n={};for(const[a,t]of Object.entries(e))switch(a){case"preset":PAGE_PRESETS.includes(t)?n.preset=t:i(`a page's preset is ${PAGE_PRESETS.join(" or ")}, not ${JSON.stringify(t)}`);break;case"paper":{const s=typeof t=="string"?t.trim().toLowerCase():void 0;s!==void 0&&Object.hasOwn(PAPERS,s)?n.paper=s:Array.isArray(t)&&t.length===2&&t.every(l)?n.paper=t:i(`a page's paper is ${Object.keys(PAPERS).join(", ")} or its width and height in mm ([210, 297]), not ${JSON.stringify(t)}`);break}case"orientation":t==="portrait"||t==="landscape"?n.orientation=t:i(`a page's orientation is portrait or landscape, not ${JSON.stringify(t)}`);break;case"margins":typeof t=="number"&&t>=0||Array.isArray(t)&&(t.length===2||t.length===4)&&t.every(s=>typeof s=="number"&&s>=0)?n.margins=t:i("a page's margins are mm: one for all four, [top and bottom, sides], or [top, right, bottom, left]");break;case"font":PAGE_FONTS.includes(t)?n.font=t:i(`a page's font is ${PAGE_FONTS.join(", ")}, not ${JSON.stringify(t)}`);break;case"size":{const s=u(t);s===void 0?i(`a page's size is ${b}`):n.size=s;break}case"line-height":l(t)?n.lineHeight=t:typeof t=="string"&&/^\d+(\.\d+)?pt$/u.test(t.trim())?n.lineHeight=t.trim():i(`a page's line-height is a multiple (1.5) or pt (28pt), not ${JSON.stringify(t)}`);break;case"text-indent":typeof t=="number"&&t>=0?n.textIndent=t:i("a page's text-indent is how many characters a paragraph's first line is set in (2)");break;case"paragraph-spacing":typeof t=="number"&&t>=0?n.paragraphSpacing=t:i("a page's paragraph-spacing is the space between paragraphs in em (0.5)");break;case"text-align":t==="left"||t==="justify"?n.textAlign=t:i(`a page's text-align is left or justify, not ${JSON.stringify(t)}`);break;case"grid":{const s=c(t)?t.chars:void 0,r=c(t)?t.lines:void 0;c(t)&&Object.keys(t).length===2&&l(s)&&l(r)&&Number.isInteger(s)&&Number.isInteger(r)?n.grid={chars:s,lines:r}:i("a page's grid is { chars, lines }: characters to a line and lines to a page");break}case"title":{const s=N(t,"the title",i);s&&(n.title=s);break}case"headings":{if(!c(t)){i("a page's headings are by level: { 1: { font, size }, 2: … }");break}const s={};for(const[r,f]of Object.entries(t)){const g=Number(r);if(!Number.isInteger(g)||g<1||g>6){i(`a heading's level is 1 to 6, not ${r}`);continue}const p=N(f,`heading ${r}`,i);p&&(s[g]=p)}n.headings=s;break}case"header":case"footer":{const s=P(t,a,i);s!==void 0&&(n[a]=s);break}case"captions":t==="numbered"||t==="plain"?n.captions=t:i(`a page's captions are numbered or plain, not ${JSON.stringify(t)}`);break;case"bibliography":typeof t=="string"&&t.trim()!==""?n.bibliography=t.trim():i("a page's bibliography is a CSL-JSON file's path");break;case"citation-style":x.includes(t)?n.citationStyle=t:i(`a page's citation-style is ${x.join(" or ")}, not ${JSON.stringify(t)}`);break;case"accent":typeof t=="string"&&t.trim()!==""?n.accent=t.trim():i("a page's accent is a colour");break;case"cover":typeof t=="string"&&t.trim()!==""?n.cover=t.trim():i("a page's cover is a picture's path");break;case"cover-y":typeof t=="number"&&t>=0&&t<=100?n.coverY=t:i(`a cover's cover-y is 0 (its top) to 100 (its bottom), not ${JSON.stringify(t)}`);break;case"picture-dpi":t===!1?n.pictureDpi=!1:typeof t=="number"&&t>=72&&t<=2400?n.pictureDpi=t:i(`a page's picture-dpi is 72 to 2400 (dots an inch of paper), or false to print pictures as they are, not ${JSON.stringify(t)}`);break;case"page-numbers":t===!1?n.pageNumbers=!1:t!==!0&&i(`a page's page-numbers is true or false, not ${JSON.stringify(t)}`);break;default:i(`the front matter holds ${PAGE_KEYS.join(", ")}: ${a} is not one of them`)}return n}const O=e=>({...e.font===void 0?{}:{font:e.font},...e.size===void 0?{}:{size:e.size},...e.weight===void 0?{}:{weight:e.weight},...e.align===void 0?{}:{align:e.align},...e.italic===void 0?{}:{italic:e.italic},...e.rule===void 0?{}:{rule:e.rule}}),j=e=>e===!1?!1:Object.keys(e).length===1&&e.center!==void 0?e.center:{...e},v=e=>/^[ab]\d$/u.test(e)?e.toUpperCase():`${e.charAt(0).toUpperCase()}${e.slice(1)}`;export function pageLookYaml(e){return{...e.preset===void 0?{}:{preset:e.preset},...e.paper===void 0?{}:{paper:typeof e.paper=="string"?v(e.paper):[...e.paper]},...e.orientation===void 0?{}:{orientation:e.orientation},...e.margins===void 0?{}:{margins:typeof e.margins=="number"?e.margins:[...e.margins]},...e.font===void 0?{}:{font:e.font},...e.size===void 0?{}:{size:e.size},...e.lineHeight===void 0?{}:{"line-height":e.lineHeight},...e.textIndent===void 0?{}:{"text-indent":e.textIndent},...e.paragraphSpacing===void 0?{}:{"paragraph-spacing":e.paragraphSpacing},...e.textAlign===void 0?{}:{"text-align":e.textAlign},...e.grid===void 0?{}:{grid:{...e.grid}},...e.title===void 0?{}:{title:O(e.title)},...e.headings===void 0?{}:{headings:Object.fromEntries(Object.entries(e.headings).map(([n,a])=>[n,O(a)]))},...e.header===void 0?{}:{header:j(e.header)},...e.footer===void 0?{}:{footer:j(e.footer)},...e.captions===void 0?{}:{captions:e.captions},...e.bibliography===void 0?{}:{bibliography:e.bibliography},...e.citationStyle===void 0?{}:{"citation-style":e.citationStyle},...e.accent===void 0?{}:{accent:e.accent},...e.cover===void 0?{}:{cover:e.cover},...e.cover===void 0||e.coverY===void 0?{}:{"cover-y":e.coverY},...e.pageNumbers===!1?{"page-numbers":!1}:{},...e.pictureDpi===void 0?{}:{"picture-dpi":e.pictureDpi}}}
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{BACKGROUNDS as c}from"./color.js";export const CHART_PALETTE=["#2A78D6","#EB6834","#1BAF7A","#EDA100","#E87BA4","#008300"],PAPER={ink:"#1F1D1A",lead:"#605B51",leadSoft:"#847F72",rule:"#EAE6DE",ruleStrong:"#959083",ruleMid:"#D6D1C6",stone:"#F8F6F1",stone2:"#EFECE5",sheet:"#FFFFFF"},tagColors=o=>({bg:c[o??"gray"]??c.gray??PAPER.stone,fg:PAPER.ink}),TONE_COLORS={good:"#448361",bad:"#D44C47",flat:PAPER.lead};const d=o=>{const e=Number.parseInt(o.slice(1),16);return[e>>16&255,e>>8&255,e&255]};function f(o,e){const[n,l,r]=d(o);let i=0,t=1/0;return e.forEach((a,g)=>{const[C,k,u]=d(a),s=2*(n-C)**2+4*(l-k)**2+3*(r-u)**2;s<t&&(t=s,i=g)}),i}export function accentPalette(o){const e=[...CHART_PALETTE];if(o===void 0)return e;const n=f(o,e);return[o,...e.filter((l,r)=>r!==n)]}export function tint(o,e){const n=Number.parseInt(o.slice(1),16),l=r=>Math.round(255-(255-r)*e).toString(16).padStart(2,"0");return`#${l(n>>16&255)}${l(n>>8&255)}${l(n&255)}`.toUpperCase()}export const DIAGRAM_TEXT_PX=14;export function diagramConfig(o){const e=accentPalette(o.accent),n=Object.fromEntries(Array.from({length:12},(i,t)=>{const a=e[t%e.length]??PAPER.leadSoft;return[[`cScale${String(t)}`,tint(a,.22)],[`cScaleLabel${String(t)}`,PAPER.ink],[`cScalePeer${String(t)}`,tint(a,.6)],[`cScaleInv${String(t)}`,tint(a,.7)]]}).flat()),l=Object.fromEntries(e.map((i,t)=>[`pie${String(t+1)}`,i])),r=e[0]??CHART_PALETTE[0];return{startOnLoad:!1,securityLevel:"strict",htmlLabels:!1,fontFamily:o.font,theme:"base",themeCSS:`.grid .tick line { stroke: ${PAPER.rule}; } .grid .tick text { fill: ${PAPER.lead}; } .grid path { stroke-width: 0; } .lineWrapper line, line.lineWrapper { stroke: ${PAPER.leadSoft}; } .cluster-label text, .cluster-label tspan { font-weight: 600; }`,look:"classic",layout:"dagre",elk:{considerModelOrder:"NODES_AND_EDGES",forceNodeModelOrder:!0,mergeEdges:!1},flowchart:{htmlLabels:!1,nodeSpacing:36,rankSpacing:44,padding:10,curve:"basis"},sequence:{actorMargin:40,width:120,height:44,boxMargin:8,messageFontSize:14,mirrorActors:!1},gantt:{barHeight:22,barGap:6,fontSize:12,sectionFontSize:12},themeVariables:{fontFamily:o.font,fontSize:`${String(DIAGRAM_TEXT_PX)}px`,background:PAPER.sheet,primaryColor:PAPER.stone,primaryBorderColor:PAPER.ruleMid,primaryTextColor:PAPER.ink,secondaryColor:PAPER.stone2,secondaryBorderColor:PAPER.ruleMid,secondaryTextColor:PAPER.ink,tertiaryColor:PAPER.sheet,tertiaryBorderColor:PAPER.rule,tertiaryTextColor:PAPER.ink,mainBkg:PAPER.stone,nodeBorder:PAPER.ruleMid,clusterBkg:"#FCFBF8",clusterBorder:PAPER.rule,titleColor:PAPER.ink,textColor:PAPER.ink,lineColor:PAPER.leadSoft,edgeLabelBackground:PAPER.sheet,actorBkg:PAPER.stone,actorBorder:PAPER.ruleMid,actorTextColor:PAPER.ink,actorLineColor:PAPER.ruleMid,signalColor:PAPER.lead,signalTextColor:PAPER.ink,labelBoxBkgColor:PAPER.stone,labelBoxBorderColor:PAPER.ruleMid,noteBkgColor:"#FBF3DB",noteBorderColor:"#E9D9A6",noteTextColor:PAPER.ink,sectionBkgColor:PAPER.stone,altSectionBkgColor:PAPER.sheet,sectionBkgColor2:PAPER.stone,gridColor:PAPER.rule,taskBkgColor:tint(r,.35),taskBorderColor:tint(r,.8),taskTextColor:PAPER.ink,taskTextLightColor:PAPER.ink,taskTextOutsideColor:PAPER.ink,activeTaskBkgColor:tint(r,.18),activeTaskBorderColor:tint(r,.8),doneTaskBkgColor:PAPER.stone2,doneTaskBorderColor:PAPER.ruleMid,critBkgColor:tint("#D6403A",.3),critBorderColor:"#D6403A",...n,...l,pieStrokeColor:PAPER.sheet,pieOuterStrokeColor:PAPER.rule,pieTitleTextColor:PAPER.ink,pieSectionTextColor:PAPER.ink,pieLegendTextColor:PAPER.ink}}}
2
+ import{BACKGROUNDS as c}from"./color.js";export const CHART_PALETTE=["#2A78D6","#EB6834","#1BAF7A","#EDA100","#E87BA4","#008300"],PAPER={ink:"#1F1D1A",lead:"#605B51",leadSoft:"#847F72",rule:"#EAE6DE",ruleStrong:"#959083",ruleMid:"#D6D1C6",stone:"#F8F6F1",stone2:"#EFECE5",stone3:"#E4E0D7",sheet:"#FFFFFF"},tagColors=o=>({bg:c[o??"gray"]??c.gray??PAPER.stone,fg:PAPER.ink}),TONE_COLORS={good:"#448361",bad:"#D44C47",flat:PAPER.lead};const d=o=>{const e=Number.parseInt(o.slice(1),16);return[e>>16&255,e>>8&255,e&255]};function f(o,e){const[n,l,r]=d(o);let i=0,t=1/0;return e.forEach((a,g)=>{const[C,k,u]=d(a),s=2*(n-C)**2+4*(l-k)**2+3*(r-u)**2;s<t&&(t=s,i=g)}),i}export function accentPalette(o){const e=[...CHART_PALETTE];if(o===void 0)return e;const n=f(o,e);return[o,...e.filter((l,r)=>r!==n)]}export function tint(o,e){const n=Number.parseInt(o.slice(1),16),l=r=>Math.round(255-(255-r)*e).toString(16).padStart(2,"0");return`#${l(n>>16&255)}${l(n>>8&255)}${l(n&255)}`.toUpperCase()}export const DIAGRAM_TEXT_PX=14;export function diagramConfig(o){const e=accentPalette(o.accent),n=Object.fromEntries(Array.from({length:12},(i,t)=>{const a=e[t%e.length]??PAPER.leadSoft;return[[`cScale${String(t)}`,tint(a,.22)],[`cScaleLabel${String(t)}`,PAPER.ink],[`cScalePeer${String(t)}`,tint(a,.6)],[`cScaleInv${String(t)}`,tint(a,.7)]]}).flat()),l=Object.fromEntries(e.map((i,t)=>[`pie${String(t+1)}`,i])),r=e[0]??CHART_PALETTE[0];return{startOnLoad:!1,securityLevel:"strict",htmlLabels:!1,fontFamily:o.font,theme:"base",themeCSS:`.grid .tick line { stroke: ${PAPER.rule}; } .grid .tick text { fill: ${PAPER.lead}; } .grid path { stroke-width: 0; } .lineWrapper line, line.lineWrapper { stroke: ${PAPER.leadSoft}; } .cluster-label text, .cluster-label tspan { font-weight: 600; }`,look:"classic",layout:"dagre",elk:{considerModelOrder:"NODES_AND_EDGES",forceNodeModelOrder:!0,mergeEdges:!1},flowchart:{htmlLabels:!1,nodeSpacing:36,rankSpacing:44,padding:10,curve:"basis"},sequence:{actorMargin:40,width:120,height:44,boxMargin:8,messageFontSize:14,mirrorActors:!1},gantt:{barHeight:22,barGap:6,fontSize:12,sectionFontSize:12},themeVariables:{fontFamily:o.font,fontSize:`${String(DIAGRAM_TEXT_PX)}px`,background:PAPER.sheet,primaryColor:PAPER.stone,primaryBorderColor:PAPER.ruleMid,primaryTextColor:PAPER.ink,secondaryColor:PAPER.stone2,secondaryBorderColor:PAPER.ruleMid,secondaryTextColor:PAPER.ink,tertiaryColor:PAPER.sheet,tertiaryBorderColor:PAPER.rule,tertiaryTextColor:PAPER.ink,mainBkg:PAPER.stone,nodeBorder:PAPER.ruleMid,clusterBkg:"#FCFBF8",clusterBorder:PAPER.rule,titleColor:PAPER.ink,textColor:PAPER.ink,lineColor:PAPER.leadSoft,edgeLabelBackground:PAPER.sheet,actorBkg:PAPER.stone,actorBorder:PAPER.ruleMid,actorTextColor:PAPER.ink,actorLineColor:PAPER.ruleMid,signalColor:PAPER.lead,signalTextColor:PAPER.ink,labelBoxBkgColor:PAPER.stone,labelBoxBorderColor:PAPER.ruleMid,noteBkgColor:"#FBF3DB",noteBorderColor:"#E9D9A6",noteTextColor:PAPER.ink,sectionBkgColor:PAPER.stone,altSectionBkgColor:PAPER.sheet,sectionBkgColor2:PAPER.stone,gridColor:PAPER.rule,taskBkgColor:tint(r,.35),taskBorderColor:tint(r,.8),taskTextColor:PAPER.ink,taskTextLightColor:PAPER.ink,taskTextOutsideColor:PAPER.ink,activeTaskBkgColor:tint(r,.18),activeTaskBorderColor:tint(r,.8),doneTaskBkgColor:PAPER.stone2,doneTaskBorderColor:PAPER.ruleMid,critBkgColor:tint("#D6403A",.3),critBorderColor:"#D6403A",...n,...l,pieStrokeColor:PAPER.sheet,pieOuterStrokeColor:PAPER.rule,pieTitleTextColor:PAPER.ink,pieSectionTextColor:PAPER.ink,pieLegendTextColor:PAPER.ink}}}
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- const c=/^[+\-−–]?[$€£¥]?\s?\d[\d,.\s]*\s?(%|×|x|k|K|M|B|bn|pt|pp)?\*?$/u,x=/^([—–-]|n\/a|N\/A|NA)$/u,d=t=>t.map(e=>e.text).join("").trim();export function numberColumns(t){const e=t.head===void 0||t.head==="both",s=t.head==="column"||t.head==="both",r=e?t.rows.slice(1):t.rows,m=Math.max(0,...t.rows.map(o=>o.length)),a=new Set;for(let o=s?1:0;o<m;o++){const u=r.map(n=>d(n[o]??[]));u.some(n=>c.test(n))&&u.every(n=>n===""||c.test(n)||x.test(n))&&a.add(o)}return a}const h={min:6,max:36,room:2};export function columnShares(t){const e=Math.max(0,...t.rows.map(s=>s.length));return Array.from({length:e},(s,r)=>{const m=Math.max(0,...t.rows.map(a=>Array.from(d(a[r]??[])).length));return Math.min(h.max,Math.max(h.min,m+h.room))})}
2
+ const w=/^[+\-−–]?[$€£¥]?\s?\d[\d,.\s]*\s?(%|×|x|k|K|M|B|bn|pt|pp)?\*?$/u,A=/^([—–-]|n\/a|N\/A|NA)$/u,f=t=>t.map(n=>n.text).join("").trim();export function numberColumns(t){const n=t.head===void 0||t.head==="both",r=t.head==="column"||t.head==="both",m=n?t.rows.slice(1):t.rows,d=Math.max(0,...t.rows.map(a=>a.length)),h=new Set;for(let a=r?1:0;a<d;a++){const c=m.map(o=>f(o[a]??[]));c.some(o=>w.test(o))&&c.every(o=>o===""||w.test(o)||A.test(o))&&h.add(a)}return h}export function emptyHead(t){const n=t.head===void 0||t.head==="both",r=t.rows[0];return n&&r!==void 0&&t.rows.length>1&&r.every(m=>f(m)==="")}const u={min:6,max:36,room:2},y=.55;export const charsAcross=(t,n)=>t/(n*96/72)/y;const N=t=>Math.max(0,...t.split(/\s+/u).map(n=>Array.from(n).length));export function columnShares(t,n){const r=Math.max(0,...t.rows.map(s=>s.length)),m=s=>t.rows.map(e=>f(e[s]??[])),d=s=>Math.max(0,...m(s).map(e=>Array.from(e).length)),h=Array.from({length:r},(s,e)=>Math.min(u.max,Math.max(u.min,d(e)+u.room)));if(n===void 0)return h;const a=h.map((s,e)=>Math.max(0,...m(e).map(N))+n.margins),c=h.map((s,e)=>Math.max(a[e]??0,Math.min(u.max,Math.max(u.min,d(e)))+n.margins)),o=s=>!t.widths?.[s],M=s=>s.reduce((e,p,l)=>e+(o(l)?p:0),0),i=M(a),x=M(c);if(x<=n.across||x===i)return c;if(i>=n.across)return a;const g=(n.across-i)/(x-i);return c.map((s,e)=>{const p=a[e]??s;return p+(s-p)*g})}
@@ -1,54 +1,54 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{Document as K,visit as Y}from"yaml";import{pageLookYaml as F}from"./page.js";import{BLOCK_TAG as C,CALLOUT_TAG as M,CARD_TAG as E,STAT_TAG as J,STATS_TAG as R,TAG_TAG as I,CHART_TAG as L,PAGE_BREAK_TAG as Q,COLUMN_TAG as B,COLUMNS_TAG as N,COMPONENT_TAG as V,TABLE_TAG as U,TOC_TAG as X,BIBLIOGRAPHY_TAG as Z}from"./parse.js";const A=["link","span","tag","underline","bold","italic","strike","code"];function g(e,n){switch(n){case"link":return e.href;case"tag":return e.styles.tag;case"span":return e.styles.color!==void 0||e.styles.background!==void 0?`${e.styles.color??""}
2
+ import{Document as K,visit as Y}from"yaml";import{pageLookYaml as F}from"./page.js";import{BLOCK_TAG as M,CALLOUT_TAG as E,CARD_TAG as R,STAT_TAG as J,STATS_TAG as I,TAG_TAG as B,CHART_TAG as O,PAGE_BREAK_TAG as Q,COLUMN_TAG as N,COLUMNS_TAG as U,COMPONENT_TAG as V,TABLE_TAG as W,TOC_TAG as X,BIBLIOGRAPHY_TAG as Z}from"./parse.js";const A=["link","span","tag","underline","bold","italic","strike","code"];function g(e,n){switch(n){case"link":return e.href;case"tag":return e.styles.tag;case"span":return e.styles.color!==void 0||e.styles.background!==void 0?`${e.styles.color??""}
3
3
  ${e.styles.background??""}`:void 0;default:return e.styles[n]?"on":void 0}}const s=(e,n)=>n===void 0?"":` ${e}="${n.replace(/&/g,"&amp;").replace(/"/g,"&quot;")}"`,_=e=>e!==void 0&&/[\p{L}\p{N}]/u.test(e);function G(e,n,r=n){let t="";const i=Array.from(e);return i.forEach((a,d)=>{const u=i[d-1],c=i[d+1];switch(a){case"\\":case"*":case"`":case"[":case"]":case"<":case">":case"{":case"}":case"~":t+=`\\${a}`;break;case"_":t+=_(u)&&_(c)?a:`\\${a}`;break;case"&":t+=/^&(#\d+|#x[0-9a-f]+|[a-z][a-z0-9]*);/i.test(i.slice(d,d+34).join(""))?"&amp;":a;break;case"|":t+=n?"\\|":a;break;case"!":t+=c===void 0?"\\!":a;break;case`
4
4
  `:t+=r?"<br />":`\\
5
- `;break;default:t+=a}}),t}function b(e){const n=Math.max(0,...(e.match(/`+/g)??[]).map(i=>i.length)),r="`".repeat(n+1),t=e.startsWith("`")||e.endsWith("`")||e.startsWith(" ")&&e.endsWith(" ")&&e.trim()!==""?" ":"";return`${r}${t}${e}${t}${r}`}const k={bold:"**",italic:"*",strike:"~~"},W={underline:"u",bold:"strong",italic:"em",strike:"del",code:"code"};function T(e,n){let r="",t=0,i=!0;for(;t<e.length;){const a=e[t];if(a===void 0)break;if(a.note!==void 0||a.cite!==void 0){r+=a.note===void 0?`[${a.cite??""}]`:`[^${a.note}]`,i=!1,t++;continue}const d=A.find(f=>!n.used.has(f)&&g(a,f)!==void 0);if(d===void 0){r+=G(a.text,n.inTable,n.oneLine),i=!0,t++;continue}const u=g(a,d);let c=t+1;for(;c<e.length;){const f=e[c];if(f===void 0||g(f,d)!==u||d==="code"&&A.some(p=>p!=="code"&&!n.used.has(p)&&g(f,p)!==void 0))break;c++}const o=e.slice(t,c),$=new Set([...n.used,d]),h=o.map(f=>f.text).join(""),j=e[c],q=j===void 0||A.every(f=>n.used.has(f)||g(j,f)===void 0);if(d==="code")r+=h.includes(`
6
- `)||n.inTable&&h.includes("|")?`<code>${G(h,n.inTable,n.oneLine)}</code>`:b(h);else if(d==="link"){const f=T(o,{...n,used:$}),p=(u??"").replace(/[\s()<>\\]/g,x=>encodeURIComponent(x));r+=`[${f}](${p})`}else if(d==="tag"){const f=T(o,{...n,used:$});r+=`<${I}${s("color",u)}>${f}</${I}>`}else if(d==="span"){const f=T(o,{...n,used:$}),p=o[0];r+=`<span${s("color",p?.styles.color)}${s("bg",p?.styles.background)}>${f}</span>`}else{const f=T(o,{...n,used:$}),p=k[d],x=Array.from(h),D=t===0&&c===e.length,P=n.used.has("bold")||n.used.has("italic")||n.used.has("strike"),O=w=>w!==void 0&&A.every(y=>$.has(y)||g(w,y)===void 0),z=d==="bold"&&o.every(w=>w.styles.italic===!0&&A.every(y=>y==="italic"||$.has(y)||g(w,y)===void 0)),H=p!==void 0&&_(x[0])&&_(x.at(-1))&&!h.includes(`
7
- `)&&i&&q&&(!P||D&&d==="italic"&&n.used.has("bold"))&&(O(o[0])&&O(o.at(-1))||z);r+=H?`${p}${f}${p}`:`<${W[d]}>${f}</${W[d]}>`}i=!1,t=c}return r}function ee(e){if(/^(import|export)(\s|$)/.test(e))return`&#x${e.charCodeAt(0).toString(16)};${e.slice(1)}`;if(/^(#{1,6}(\s|$)|[-+](\s|$)|[=-]+\s*$|[|:\-\s]*-[|:\-\s]*$)/.test(e))return`\\${e}`;const n=/^(\d{1,9})([.)])(\s|$)/.exec(e);return n?.[1]!==void 0?`${n[1]}\\${e.slice(n[1].length)}`:e}function l(e,n=!1,r=n){const t=e.filter(d=>d.text!==""||d.href!==void 0).map((d,u,c)=>{if(d.note===void 0)return d;const o=c.slice(0,u).findLast($=>$.note===void 0);return o===void 0?d:{...d,styles:{...o.styles},...o.href===void 0?{}:{href:o.href}}}),i=T(t,{inTable:n,oneLine:r,used:new Set}),a=d=>d.replace(/ +$/,"").replace(/^ +/,u=>"&#x20;".repeat(u.length));return r?a(i):i.split(`
8
- `).map(d=>ee(a(d))).join(`
9
- `)}const v=(e,n)=>e.split(`
5
+ `;break;default:t+=a}}),t}function b(e){const n=Math.max(0,...(e.match(/`+/g)??[]).map(i=>i.length)),r="`".repeat(n+1),t=e.startsWith("`")||e.endsWith("`")||e.startsWith(" ")&&e.endsWith(" ")&&e.trim()!==""?" ":"";return`${r}${t}${e}${t}${r}`}const k={bold:"**",italic:"*",strike:"~~"},q={underline:"u",bold:"strong",italic:"em",strike:"del",code:"code"};function T(e,n){let r="",t=0,i=!0;for(;t<e.length;){const a=e[t];if(a===void 0)break;if(a.note!==void 0||a.cite!==void 0){r+=a.note===void 0?`[${a.cite??""}]`:`[^${a.note}]`,i=!1,t++;continue}const d=A.find($=>!n.used.has($)&&g(a,$)!==void 0);if(d===void 0){r+=G(a.text,n.inTable,n.oneLine),i=!0,t++;continue}const u=g(a,d);let c=t+1;for(;c<e.length;){const $=e[c];if($===void 0||g($,d)!==u||d==="code"&&A.some(p=>p!=="code"&&!n.used.has(p)&&g($,p)!==void 0))break;c++}const o=e.slice(t,c),f=new Set([...n.used,d]),h=o.map($=>$.text).join(""),j=e[c],D=j===void 0||A.every($=>n.used.has($)||g(j,$)===void 0);if(d==="code")r+=h.includes(`
6
+ `)||n.inTable&&h.includes("|")?`<code>${G(h,n.inTable,n.oneLine)}</code>`:b(h);else if(d==="link"){const $=T(o,{...n,used:f}),p=(u??"").replace(/[\s<>\\]/g,L=>encodeURIComponent(L)),x=ee(p)?p:p.replace(/[()]/g,"\\$&");r+=`[${$}](${x})`}else if(d==="tag"){const $=T(o,{...n,used:f});r+=`<${B}${s("color",u)}>${$}</${B}>`}else if(d==="span"){const $=T(o,{...n,used:f}),p=o[0];r+=`<span${s("color",p?.styles.color)}${s("bg",p?.styles.background)}>${$}</span>`}else{const $=T(o,{...n,used:f}),p=k[d],x=Array.from(h),L=t===0&&c===e.length,P=n.used.has("bold")||n.used.has("italic")||n.used.has("strike"),C=w=>w!==void 0&&A.every(y=>f.has(y)||g(w,y)===void 0),z=d==="bold"&&o.every(w=>w.styles.italic===!0&&A.every(y=>y==="italic"||f.has(y)||g(w,y)===void 0)),H=p!==void 0&&_(x[0])&&_(x.at(-1))&&!h.includes(`
7
+ `)&&i&&D&&(!P||L&&d==="italic"&&n.used.has("bold"))&&(C(o[0])&&C(o.at(-1))||z);r+=H?`${p}${$}${p}`:`<${q[d]}>${$}</${q[d]}>`}i=!1,t=c}return r}function ee(e){let n=0;for(const r of e)if(r==="(")n+=1;else if(r===")"&&--n<0)return!1;return n===0}function ne(e){if(/^[ \t]/.test(e))return`&#x${e.charCodeAt(0).toString(16)};${e.slice(1)}`;if(/^(import|export)(\s|$)/.test(e))return`&#x${e.charCodeAt(0).toString(16)};${e.slice(1)}`;if(/^(#{1,6}(\s|$)|[-+](\s|$)|[=-]+\s*$|[|:\-\s]*-[|:\-\s]*$)/.test(e))return`\\${e}`;const n=/^(\d{1,9})([.)])(\s|$)/.exec(e);return n?.[1]!==void 0?`${n[1]}\\${e.slice(n[1].length)}`:e}function l(e,n=!1,r=n){const t=e.filter(d=>d.text!==""||d.href!==void 0).map((d,u,c)=>{if(d.note===void 0)return d;const o=c.slice(0,u).findLast(f=>f.note===void 0);return o===void 0?d:{...d,styles:{...o.styles},...o.href===void 0?{}:{href:o.href}}}),i=T(t,{inTable:n,oneLine:r,used:new Set}),a=d=>d.replace(/ +$/,"").replace(/^ +/,u=>"&#x20;".repeat(u.length));return r?a(i):i.split(`
8
+ `).map(d=>ne(a(d))).join(`
9
+ `)}const S=(e,n)=>e.split(`
10
10
  `).map((r,t)=>t===0||r===""?r:`${n}${r}`).join(`
11
- `),m=e=>e.type==="bullet"||e.type==="numbered"||e.type==="check",ne=e=>`${s("align",e?.align)}${s("color",e?.color)}${s("bg",e?.background)}`,te=e=>e!==void 0&&Object.keys(e).length>0;function S(e){return!("content"in e)||e.type==="callout"?!1:te(e.look)||e.type==="toggle"||e.type==="heading"&&e.toggle?!0:(e.type==="paragraph"||e.type==="heading")&&(e.children?.length??0)>0}function re(e){const n=Math.max(2,...(e.match(/^\s*`{3,}/gm)??[]).map(r=>r.trim().length));return"`".repeat(n+1)}function se(e,n,r){const t=e.type==="numbered"?`${String(n)}${r} `:e.type==="check"?`- [${e.checked?"x":" "}] `:"- ",i=" ".repeat(e.type==="numbered"?t.length:2),a=e.children??[],d=l(e.content)||(e.type==="check"&&(e.children??[]).length===0?"<br />":"");if(a.length===0)return`${t}${v(d,i)}`.trimEnd();const u=d===""?"<br />":d,[c]=a,o=c!==void 0&&m(c)&&l(c.content)!==""&&!(c.type==="numbered"&&(c.start??1)!==1),$=a.every(m)&&d!==""&&o;return`${t}${v(u,i)}${$?`
11
+ `),m=e=>e.type==="bullet"||e.type==="numbered"||e.type==="check",te=e=>`${s("align",e?.align)}${s("color",e?.color)}${s("bg",e?.background)}`,re=e=>e!==void 0&&Object.keys(e).length>0;function v(e){return!("content"in e)||e.type==="callout"?!1:re(e.look)||e.type==="toggle"||e.type==="heading"&&e.toggle?!0:(e.type==="paragraph"||e.type==="heading")&&(e.children?.length??0)>0}function se(e){const n=Math.max(2,...(e.match(/^\s*`{3,}/gm)??[]).map(r=>r.trim().length));return"`".repeat(n+1)}function ie(e,n,r){const t=e.type==="numbered"?`${String(n)}${r} `:e.type==="check"?`- [${e.checked?"x":" "}] `:"- ",i=" ".repeat(e.type==="numbered"?t.length:2),a=e.children??[],d=l(e.content)||(e.type==="check"&&(e.children??[]).length===0?"<br />":"");if(a.length===0)return`${t}${S(d,i)}`.trimEnd();const u=d===""?"<br />":d,[c]=a,o=c!==void 0&&m(c)&&l(c.content)!==""&&!(c.type==="numbered"&&(c.start??1)!==1),f=a.every(m)&&d!==""&&o;return`${t}${S(u,i)}${f?`
12
12
  `:`
13
13
 
14
- `}${i}${v(writeBlocks(a),i)}`}function ie(e){switch(e.type){case"paragraph":{const n=l(e.content);return n===""?"<br />":n}case"heading":return`${"#".repeat(e.level)} ${l(e.content,!1,!0).replace(/(^| )(#+)$/,"$1\\$2")}`.trimEnd();case"toggle":return l(e.content)||"<br />";case"quote":{const n=l(e.content);return(e.children?.length?[n===""?"<br />":n,writeBlocks(e.children)]:[n]).join(`
14
+ `}${i}${S(writeBlocks(a),i)}`}function de(e){switch(e.type){case"paragraph":{const n=l(e.content);return n===""?"<br />":n}case"heading":return`${"#".repeat(e.level)} ${l(e.content,!1,!0).replace(/(^| )(#+)$/,"$1\\$2")}`.trimEnd();case"toggle":return l(e.content)||"<br />";case"quote":{const n=l(e.content);return(e.children?.length?[n===""?"<br />":n,writeBlocks(e.children)]:[n]).join(`
15
15
 
16
16
  `).split(`
17
17
  `).map(t=>t===""?">":`> ${t}`).join(`
18
18
  `)}case"callout":{const n=l(e.content),r=[n===""?"<br />":n,...e.children?.length?[writeBlocks(e.children)]:[]].join(`
19
19
 
20
- `);return`<${M}${s("icon",e.icon)}${s("color",e.look?.color)}${s("bg",e.look?.background)}>
20
+ `);return`<${E}${s("icon",e.icon)}${s("color",e.look?.color)}${s("bg",e.look?.background)}>
21
21
 
22
22
  ${r}
23
23
 
24
- </${M}>`}case"card":{const n=e.children?.length?writeBlocks(e.children):"";return`<${E}${s("title",e.title)}${s("subtitle",e.subtitle)}>
24
+ </${E}>`}case"card":{const n=e.children?.length?writeBlocks(e.children):"";return`<${R}${s("title",e.title)}${s("subtitle",e.subtitle)}>
25
25
 
26
26
  ${n===""?"<br />":n}
27
27
 
28
- </${E}>`}case"stats":return[`<${R}>`,...e.stats.map(n=>`<${J}${s("label",n.label)}${s("value",n.value)}${s("delta",n.delta)}${s("note",n.note)}${n.downIsGood?" down-is-good":""}${s("trend",n.trend?.join(","))} />`),`</${R}>`].join(`
29
- `);case"code":{const n=re(e.code);return`${n}${e.language??""}
28
+ </${R}>`}case"stats":return[`<${I}>`,...e.stats.map(n=>`<${J}${s("label",n.label)}${s("value",n.value)}${s("delta",n.delta)}${s("note",n.note)}${n.downIsGood?" down-is-good":""}${s("trend",n.trend?.join(","))} />`),`</${I}>`].join(`
29
+ `);case"code":{const n=se(e.code);return`${n}${e.language??""}
30
30
  ${e.code}
31
31
  ${n}`}case"image":{const n=e.src.replace(/[\s()<>\\]/g,t=>encodeURIComponent(t));if(e.width!==void 0||e.align!==void 0||e.id!==void 0)return`<img${s("src",e.src)}${s("alt",e.alt)}${s("title",e.caption)}${s("width",e.width===void 0?void 0:String(e.width))}${s("align",e.align)}${s("id",e.id)} />`;const r=e.caption===void 0?"":` "${e.caption.replace(/["\\]/g,"\\$&")}"`;return`![${G(e.alt??"",!1)}](${n}${r})`}case"table":{const n=Math.max(1,...e.rows.map(u=>u.length)),r=u=>`| ${Array.from({length:n},(c,o)=>l(u[o]??[],!0)).join(" | ")} |`,[t,...i]=e.rows,a=[r(t??[]),`| ${Array.from({length:n},()=>"---").join(" | ")} |`,...i.map(r)].join(`
32
- `),d=e.widths?.some(u=>u!==null)?e.widths.map(u=>u===null?"":String(u)).join(","):void 0;return d===void 0&&e.head===void 0&&e.caption===void 0&&e.id===void 0?a:`<${U}${s("widths",d)}${s("head",e.head)}${s("caption",e.caption)}${s("id",e.id)}>
32
+ `),d=e.widths?.some(u=>u!==null)?e.widths.map(u=>u===null?"":String(u)).join(","):void 0;return d===void 0&&e.head===void 0&&e.caption===void 0&&e.id===void 0?a:`<${W}${s("widths",d)}${s("head",e.head)}${s("caption",e.caption)}${s("id",e.id)}>
33
33
 
34
34
  ${a}
35
35
 
36
- </${U}>`}case"divider":return"---";case"component":{const n=t=>t===void 0?void 0:String(t),r=Object.entries(e.props).map(([t,i])=>s(t,i)).join("");return`<${V}${s("of",e.of)}${s("width",n(e.width))}${s("height",n(e.height))}${s("at",n(e.at))}${r}${s("alt",e.alt)}${s("title",e.caption)}${s("align",e.align)}${s("id",e.id)} />`}case"chart":return de(e);case"pagebreak":return`<${Q}${s("orientation",e.orientation)} />`;case"bibliography":return`<${Z} />`;case"toc":return`<${X}${s("levels",e.levels===void 0?void 0:String(e.levels))}${s("title",e.title)} />`;case"note":{const n=l(e.content)||"<br />",r=e.children?.length?`
36
+ </${W}>`}case"divider":return"---";case"component":{const n=t=>t===void 0?void 0:String(t),r=Object.entries(e.props).map(([t,i])=>s(t,i)).join("");return`<${V}${s("of",e.of)}${s("width",n(e.width))}${s("height",n(e.height))}${s("at",n(e.at))}${r}${s("alt",e.alt)}${s("title",e.caption)}${s("align",e.align)}${s("id",e.id)} />`}case"chart":return ae(e);case"pagebreak":return`<${Q}${s("orientation",e.orientation)} />`;case"bibliography":return`<${Z} />`;case"toc":return`<${X}${s("levels",e.levels===void 0?void 0:String(e.levels))}${s("title",e.title)} />`;case"note":{const n=l(e.content)||"<br />",r=e.children?.length?`
37
37
 
38
38
  ${writeBlocks(e.children).split(`
39
39
  `).map(t=>t===""?t:` ${t}`).join(`
40
- `)}`:"";return`[^${e.label}]: ${v(n," ")}${r}`}case"columns":return[`<${N}>`,...e.columns.map(n=>{const r=writeBlocks(n.blocks);return`<${B}${s("width",n.width===void 0?void 0:String(n.width))}>
40
+ `)}`:"";return`[^${e.label}]: ${S(n," ")}${r}`}case"columns":return[`<${U}>`,...e.columns.map(n=>{const r=writeBlocks(n.blocks);return`<${N}${s("width",n.width===void 0?void 0:String(n.width))}>
41
41
 
42
42
  ${r===""?"<br />":r}
43
43
 
44
- </${B}>`}),`</${N}>`].join(`
44
+ </${N}>`}),`</${U}>`].join(`
45
45
 
46
- `);case"embed":case"source":return e.source}}function de(e){const n=$=>$===void 0?void 0:String($),r=$=>$===void 0?void 0:$.join(","),t=e.labels?.length===1&&e.labels[0]==="value"?" labels":s("labels",r(e.labels)),i=[s("type",e.kind),s("title",e.title),s("data",e.data),s("categories",e.categories),s("series",r(e.series)),s("legend",e.legend),t,s("format",e.format),s("min",n(e.min)),s("max",n(e.max)),s("colors",r(e.colors)),e.smooth?" smooth":"",s("width",n(e.width)),s("height",n(e.height)),s("alt",e.alt),s("id",e.id)].join("");if(e.table===void 0)return`<${L}${i} />`;const a=Math.max(1,...e.table.map($=>$.length)),d=$=>`| ${Array.from({length:a},(h,j)=>G($[j]??"",!0)).join(" | ")} |`,[u,...c]=e.table,o=[d(u??[]),`| ${Array.from({length:a},()=>"---").join(" | ")} |`,...c.map(d)].join(`
47
- `);return`<${L}${i}>
46
+ `);case"embed":case"source":return e.source}}function ae(e){const n=f=>f===void 0?void 0:String(f),r=f=>f===void 0?void 0:f.join(","),t=e.labels?.length===1&&e.labels[0]==="value"?" labels":s("labels",r(e.labels)),i=[s("type",e.kind),s("title",e.title),s("data",e.data),s("categories",e.categories),s("series",r(e.series)),s("legend",e.legend),t,s("format",e.format),s("min",n(e.min)),s("max",n(e.max)),s("colors",r(e.colors)),e.smooth?" smooth":"",s("width",n(e.width)),s("height",n(e.height)),s("alt",e.alt),s("id",e.id)].join("");if(e.table===void 0)return`<${O}${i} />`;const a=Math.max(1,...e.table.map(f=>f.length)),d=f=>`| ${Array.from({length:a},(h,j)=>G(f[j]??"",!0)).join(" | ")} |`,[u,...c]=e.table,o=[d(u??[]),`| ${Array.from({length:a},()=>"---").join(" | ")} |`,...c.map(d)].join(`
47
+ `);return`<${O}${i}>
48
48
 
49
49
  ${o}
50
50
 
51
- </${L}>`}export function frontMatterOf(e){const n=F(e);if(Object.keys(n).length===0)return"";const r=new K(n);return Y(r,{Seq:(t,i)=>{i.flow=!0},Map:(t,i,a)=>{a.length>1&&(i.flow=!0)}}),r.toString({lineWidth:0}).trimEnd()}export function withPage(e,n){const r=frontMatterOf(n),t=r===""?"":`---
51
+ </${O}>`}export function frontMatterOf(e){const n=F(e);if(Object.keys(n).length===0)return"";const r=new K(n);return Y(r,{Seq:(t,i)=>{i.flow=!0},Map:(t,i,a)=>{a.length>1&&(i.flow=!0)}}),r.toString({lineWidth:0}).trimEnd()}export function withPage(e,n){const r=frontMatterOf(n),t=r===""?"":`---
52
52
  ${r}
53
53
  ---`,i=e.frontMatter;if(i===void 0){if(t==="")return e.source;const d=e.source.replace(/^\s+/u,"");return d===""?`${t}
54
54
  `:`${t}
@@ -56,13 +56,13 @@ ${r}
56
56
  ${d}`}const a=e.source.slice(i.end).replace(/^\s+/u,"");return t===""?a:a===""?`${t}
57
57
  `:`${t}
58
58
 
59
- ${a}`}function ae(e){const n=e.type==="toggle"||e.type==="heading"&&e.toggle,{children:r}=e,t={...e};delete t.look,delete t.children;const i=t.type==="toggle"?{type:"paragraph",content:t.content}:t.type==="heading"?{type:"heading",level:t.level,content:t.content}:t,a=m(i)||i.type==="quote",d=writeBlocks(a?[{...i,...r?{children:r}:{}}]:[i,...r??[]]);return`<${C}${ne(e.look)}${n?" toggle":""}>
59
+ ${a}`}function oe(e){const n=e.type==="toggle"||e.type==="heading"&&e.toggle,{children:r}=e,t={...e};delete t.look,delete t.children;const i=t.type==="toggle"?{type:"paragraph",content:t.content}:t.type==="heading"?{type:"heading",level:t.level,content:t.content}:t,a=m(i)||i.type==="quote",d=writeBlocks(a?[{...i,...r?{children:r}:{}}]:[i,...r??[]]);return`<${M}${te(e.look)}${n?" toggle":""}>
60
60
 
61
61
  ${d}
62
62
 
63
- </${C}>`}export function continuesList(e,n){return m(e)&&m(n)&&!S(e)&&!S(n)&&e.type==="numbered"==(n.type==="numbered")&&!(n.type==="numbered"&&n.start!==void 0)}export function writeBlocks(e){const n=[];let r=0,t;for(;r<e.length;){const i=e[r];if(i===void 0)break;if(S(i)){n.push(ae(i)),t=void 0,r++;continue}if(!m(i)){n.push(r===0&&i.type==="divider"?"***":ie(i)),t=void 0,r++;continue}const a=i.type==="numbered",d=i.type==="numbered"?i.start??1:1,u=a&&t==="."?")":".",c=[];let o=r;for(;o<e.length;){const h=e[o];if(h===void 0||!m(h)||S(h)||h.type==="numbered"!==a||o>r&&!continuesList(i,h))break;c.push(se(h,d+(o-r),u)),o++}const $=c.some(h=>h.includes(`
63
+ </${M}>`}export function continuesList(e,n){return m(e)&&m(n)&&!v(e)&&!v(n)&&e.type==="numbered"==(n.type==="numbered")&&!(n.type==="numbered"&&n.start!==void 0)}export function writeBlocks(e){const n=[];let r=0,t;for(;r<e.length;){const i=e[r];if(i===void 0)break;if(v(i)){n.push(oe(i)),t=void 0,r++;continue}if(!m(i)){n.push(r===0&&i.type==="divider"?"***":de(i)),t=void 0,r++;continue}const a=i.type==="numbered",d=i.type==="numbered"?i.start??1:1,u=a&&t==="."?")":".",c=[];let o=r;for(;o<e.length;){const h=e[o];if(h===void 0||!m(h)||v(h)||h.type==="numbered"!==a||o>r&&!continuesList(i,h))break;c.push(ie(h,d+(o-r),u)),o++}const f=c.some(h=>h.includes(`
64
64
 
65
- `));n.push(c.join($?`
65
+ `));n.push(c.join(f?`
66
66
 
67
67
  `:`
68
68
  `)),t=a?u:void 0,r=o}return n.join(`