ooxml-core 1.50.2 → 1.51.1

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 (366) hide show
  1. package/README.md +11 -0
  2. package/dist/{PptxHandler-PVQW47CY.mjs → PptxHandler-6GRVJRHP.mjs} +2 -2
  3. package/dist/PptxHandler-E6QYPF7X.mjs +8 -0
  4. package/dist/PptxHandler-UNQVCIGM.cjs +17 -0
  5. package/dist/PresentationBuilder-DVDJSV5R.mjs +8 -0
  6. package/dist/PresentationBuilder-F5UWRF6H.cjs +25 -0
  7. package/dist/{PresentationBuilder-ZOOVSBPR.mjs → PresentationBuilder-T6YKWPF7.mjs} +2 -2
  8. package/dist/automation/index.cjs +5806 -4494
  9. package/dist/automation/index.mjs +5806 -4494
  10. package/dist/chunk-25IJEN7R.cjs +36 -0
  11. package/dist/chunk-25JN3ZQM.mjs +58 -0
  12. package/dist/{chunk-7XYVFUB3.cjs → chunk-2IO523MM.cjs} +1 -0
  13. package/dist/{chunk-53KMIHYN.mjs → chunk-4LUZHBTT.mjs} +83 -31
  14. package/dist/chunk-554UZLPS.mjs +237 -0
  15. package/dist/{chunk-VLKUMQGT.mjs → chunk-63RAF3TS.mjs} +1 -1
  16. package/dist/{chunk-7UM5IFPR.mjs → chunk-6IUYKP77.mjs} +1 -1
  17. package/dist/{chunk-VK2G4BGX.mjs → chunk-BIMV5FVL.mjs} +481 -193
  18. package/dist/{chunk-CODMW5KF.cjs → chunk-CVUMILG3.cjs} +1 -0
  19. package/dist/{chunk-NBMXEVHL.mjs → chunk-FX6WL42B.mjs} +1 -0
  20. package/dist/chunk-GI4Y6BBX.mjs +21 -0
  21. package/dist/{chunk-MX2GFMZS.mjs → chunk-GZL4ERW3.mjs} +1 -1
  22. package/dist/chunk-HWL2AGLD.cjs +98 -0
  23. package/dist/chunk-HZAB3YDO.cjs +234 -0
  24. package/dist/chunk-IDATIFCG.mjs +226 -0
  25. package/dist/chunk-LO55N7VL.cjs +247 -0
  26. package/dist/{chunk-FFLU4LUQ.cjs → chunk-LUBPW5NP.cjs} +1629 -1609
  27. package/dist/chunk-MUNEIE2J.cjs +62 -0
  28. package/dist/{chunk-ZCKEKP7N.mjs → chunk-RYUADJV6.mjs} +4 -4
  29. package/dist/chunk-TOBK5FC4.mjs +88 -0
  30. package/dist/chunk-UV4LMGVZ.mjs +31 -0
  31. package/dist/{chunk-O3YGBYGZ.mjs → chunk-VRVHM6TJ.mjs} +1 -0
  32. package/dist/chunk-W7LVJC32.cjs +25 -0
  33. package/dist/chunk-WAZ7T2BL.cjs +169 -0
  34. package/dist/{chunk-3OKY56UM.mjs → chunk-YX33WEKS.mjs} +411 -391
  35. package/dist/docx/auto-number-fields.d.ts +22 -0
  36. package/dist/docx/auto-number-fields.d.ts.map +1 -0
  37. package/dist/docx/block-parser.d.ts.map +1 -1
  38. package/dist/docx/character-styles.d.ts.map +1 -1
  39. package/dist/docx/clipboard/css.d.ts +21 -0
  40. package/dist/docx/clipboard/css.d.ts.map +1 -0
  41. package/dist/docx/clipboard/html-tokens.d.ts +38 -0
  42. package/dist/docx/clipboard/html-tokens.d.ts.map +1 -0
  43. package/dist/docx/clipboard/index.d.ts +6 -0
  44. package/dist/docx/clipboard/index.d.ts.map +1 -0
  45. package/dist/docx/clipboard/word-fields.d.ts +13 -0
  46. package/dist/docx/clipboard/word-fields.d.ts.map +1 -0
  47. package/dist/docx/clipboard/word-fragment.d.ts +14 -0
  48. package/dist/docx/clipboard/word-fragment.d.ts.map +1 -0
  49. package/dist/docx/clipboard/word-html.d.ts +22 -0
  50. package/dist/docx/clipboard/word-html.d.ts.map +1 -0
  51. package/dist/docx/clipboard/word-list-scan.d.ts +25 -0
  52. package/dist/docx/clipboard/word-list-scan.d.ts.map +1 -0
  53. package/dist/docx/clipboard/word-lists.d.ts +13 -0
  54. package/dist/docx/clipboard/word-lists.d.ts.map +1 -0
  55. package/dist/docx/clipboard/word-runs.d.ts +18 -0
  56. package/dist/docx/clipboard/word-runs.d.ts.map +1 -0
  57. package/dist/docx/clipboard/word-styles.d.ts +35 -0
  58. package/dist/docx/clipboard/word-styles.d.ts.map +1 -0
  59. package/dist/docx/compare/build.d.ts +48 -0
  60. package/dist/docx/compare/build.d.ts.map +1 -0
  61. package/dist/docx/compare/compare.d.ts +18 -0
  62. package/dist/docx/compare/compare.d.ts.map +1 -0
  63. package/dist/docx/compare/context.d.ts +42 -0
  64. package/dist/docx/compare/context.d.ts.map +1 -0
  65. package/dist/docx/compare/diff.d.ts +20 -0
  66. package/dist/docx/compare/diff.d.ts.map +1 -0
  67. package/dist/docx/compare/index.d.ts +4 -0
  68. package/dist/docx/compare/index.d.ts.map +1 -0
  69. package/dist/docx/compare/slide.d.ts +9 -0
  70. package/dist/docx/compare/slide.d.ts.map +1 -0
  71. package/dist/docx/compare/spans.d.ts +13 -0
  72. package/dist/docx/compare/spans.d.ts.map +1 -0
  73. package/dist/docx/compare/story.d.ts +7 -0
  74. package/dist/docx/compare/story.d.ts.map +1 -0
  75. package/dist/docx/compare/table.d.ts +23 -0
  76. package/dist/docx/compare/table.d.ts.map +1 -0
  77. package/dist/docx/compare/tokens.d.ts +50 -0
  78. package/dist/docx/compare/tokens.d.ts.map +1 -0
  79. package/dist/docx/compare/types.d.ts +51 -0
  80. package/dist/docx/compare/types.d.ts.map +1 -0
  81. package/dist/docx/compatibility.d.ts +46 -0
  82. package/dist/docx/compatibility.d.ts.map +1 -0
  83. package/dist/docx/computed-fields.d.ts +39 -0
  84. package/dist/docx/computed-fields.d.ts.map +1 -0
  85. package/dist/docx/doc-property-field.d.ts +17 -0
  86. package/dist/docx/doc-property-field.d.ts.map +1 -0
  87. package/dist/docx/document-parts.d.ts +2 -0
  88. package/dist/docx/document-parts.d.ts.map +1 -1
  89. package/dist/docx/drawing-wrap.d.ts +21 -0
  90. package/dist/docx/drawing-wrap.d.ts.map +1 -0
  91. package/dist/docx/drawing.d.ts.map +1 -1
  92. package/dist/docx/embedded.cjs +3965 -2313
  93. package/dist/docx/embedded.mjs +3965 -2313
  94. package/dist/docx/field-format.d.ts +45 -0
  95. package/dist/docx/field-format.d.ts.map +1 -0
  96. package/dist/docx/field-result-spans.d.ts +62 -0
  97. package/dist/docx/field-result-spans.d.ts.map +1 -0
  98. package/dist/docx/field-runs.d.ts.map +1 -1
  99. package/dist/docx/field-stories.d.ts +9 -0
  100. package/dist/docx/field-stories.d.ts.map +1 -0
  101. package/dist/docx/find-stories.d.ts +27 -0
  102. package/dist/docx/find-stories.d.ts.map +1 -0
  103. package/dist/docx/highlight.d.ts +19 -0
  104. package/dist/docx/highlight.d.ts.map +1 -1
  105. package/dist/docx/hyperlink.d.ts +7 -0
  106. package/dist/docx/hyperlink.d.ts.map +1 -1
  107. package/dist/docx/index.cjs +7359 -3476
  108. package/dist/docx/index.d.ts +13 -1
  109. package/dist/docx/index.d.ts.map +1 -1
  110. package/dist/docx/index.mjs +7327 -3476
  111. package/dist/docx/inline-model.d.ts +21 -0
  112. package/dist/docx/inline-model.d.ts.map +1 -1
  113. package/dist/docx/inline-slots.d.ts.map +1 -1
  114. package/dist/docx/inspect-document.d.ts +21 -0
  115. package/dist/docx/inspect-document.d.ts.map +1 -0
  116. package/dist/docx/kinsoku-settings.d.ts +9 -0
  117. package/dist/docx/kinsoku-settings.d.ts.map +1 -0
  118. package/dist/docx/layout/adapt-table-floating.d.ts +11 -0
  119. package/dist/docx/layout/adapt-table-floating.d.ts.map +1 -0
  120. package/dist/docx/layout/adapt-table.d.ts.map +1 -1
  121. package/dist/docx/layout/adapter.d.ts.map +1 -1
  122. package/dist/docx/layout/computed-field-runs.d.ts +8 -0
  123. package/dist/docx/layout/computed-field-runs.d.ts.map +1 -0
  124. package/dist/docx/layout/floats.d.ts +3 -1
  125. package/dist/docx/layout/floats.d.ts.map +1 -1
  126. package/dist/docx/layout/flow-floating-table.d.ts +13 -0
  127. package/dist/docx/layout/flow-floating-table.d.ts.map +1 -0
  128. package/dist/docx/layout/flow-table.d.ts +1 -1
  129. package/dist/docx/layout/flow-table.d.ts.map +1 -1
  130. package/dist/docx/layout/index.cjs +2280 -941
  131. package/dist/docx/layout/index.mjs +2276 -942
  132. package/dist/docx/layout/input.d.ts +50 -0
  133. package/dist/docx/layout/input.d.ts.map +1 -1
  134. package/dist/docx/layout/layout.d.ts.map +1 -1
  135. package/dist/docx/layout/page-cursor.d.ts.map +1 -1
  136. package/dist/docx/layout/page-flow.d.ts.map +1 -1
  137. package/dist/docx/layout/paragraph-layout.d.ts.map +1 -1
  138. package/dist/docx/layout/paragraph-tokens.d.ts +6 -0
  139. package/dist/docx/layout/paragraph-tokens.d.ts.map +1 -1
  140. package/dist/docx/layout/result.d.ts +12 -0
  141. package/dist/docx/layout/result.d.ts.map +1 -1
  142. package/dist/docx/layout/section-flow.d.ts.map +1 -1
  143. package/dist/docx/layout/table-autofit-distribute.d.ts +18 -0
  144. package/dist/docx/layout/table-autofit-distribute.d.ts.map +1 -0
  145. package/dist/docx/layout/table-autofit-measure.d.ts +15 -0
  146. package/dist/docx/layout/table-autofit-measure.d.ts.map +1 -0
  147. package/dist/docx/layout/table-autofit.d.ts +10 -0
  148. package/dist/docx/layout/table-autofit.d.ts.map +1 -0
  149. package/dist/docx/layout/table-cell-layout.d.ts.map +1 -1
  150. package/dist/docx/layout/text-breaks.d.ts +38 -13
  151. package/dist/docx/layout/text-breaks.d.ts.map +1 -1
  152. package/dist/docx/layout/wrap.d.ts +1 -1
  153. package/dist/docx/layout/wrap.d.ts.map +1 -1
  154. package/dist/docx/list-number-fields.d.ts +25 -0
  155. package/dist/docx/list-number-fields.d.ts.map +1 -0
  156. package/dist/docx/load/index.cjs +4355 -2703
  157. package/dist/docx/load/index.mjs +4355 -2703
  158. package/dist/docx/model-paragraph.d.ts +12 -1
  159. package/dist/docx/model-paragraph.d.ts.map +1 -1
  160. package/dist/docx/model.d.ts +26 -1
  161. package/dist/docx/model.d.ts.map +1 -1
  162. package/dist/docx/note-convert.d.ts +45 -0
  163. package/dist/docx/note-convert.d.ts.map +1 -0
  164. package/dist/docx/numbering-counters.d.ts +17 -0
  165. package/dist/docx/numbering-counters.d.ts.map +1 -0
  166. package/dist/docx/numbering-format.d.ts +11 -2
  167. package/dist/docx/numbering-format.d.ts.map +1 -1
  168. package/dist/docx/outline-numbering.d.ts +6 -0
  169. package/dist/docx/outline-numbering.d.ts.map +1 -0
  170. package/dist/docx/package-information-save.d.ts +9 -0
  171. package/dist/docx/package-information-save.d.ts.map +1 -0
  172. package/dist/docx/package-information.d.ts +43 -0
  173. package/dist/docx/package-information.d.ts.map +1 -0
  174. package/dist/docx/package-properties.d.ts +5 -0
  175. package/dist/docx/package-properties.d.ts.map +1 -0
  176. package/dist/docx/paragraph-styles.d.ts +2 -0
  177. package/dist/docx/paragraph-styles.d.ts.map +1 -1
  178. package/dist/docx/parse-revisions.d.ts +2 -0
  179. package/dist/docx/parse-revisions.d.ts.map +1 -1
  180. package/dist/docx/parse-table-floating.d.ts +5 -0
  181. package/dist/docx/parse-table-floating.d.ts.map +1 -0
  182. package/dist/docx/parse-table.d.ts.map +1 -1
  183. package/dist/docx/parse.d.ts.map +1 -1
  184. package/dist/docx/part-relationships.d.ts.map +1 -1
  185. package/dist/docx/personal-information.d.ts +18 -0
  186. package/dist/docx/personal-information.d.ts.map +1 -0
  187. package/dist/docx/picture-crop-edit.d.ts +18 -0
  188. package/dist/docx/picture-crop-edit.d.ts.map +1 -0
  189. package/dist/docx/picture-watermark.d.ts +29 -0
  190. package/dist/docx/picture-watermark.d.ts.map +1 -0
  191. package/dist/docx/relationship-allocator.d.ts.map +1 -1
  192. package/dist/docx/remove-document-information.d.ts +8 -0
  193. package/dist/docx/remove-document-information.d.ts.map +1 -0
  194. package/dist/docx/revision-commands.d.ts +6 -1
  195. package/dist/docx/revision-commands.d.ts.map +1 -1
  196. package/dist/docx/revision-ids.d.ts.map +1 -1
  197. package/dist/docx/run-language.d.ts +9 -0
  198. package/dist/docx/run-language.d.ts.map +1 -0
  199. package/dist/docx/run-properties-snapshot.d.ts +9 -0
  200. package/dist/docx/run-properties-snapshot.d.ts.map +1 -0
  201. package/dist/docx/run-style-model.d.ts +4 -0
  202. package/dist/docx/run-style-model.d.ts.map +1 -1
  203. package/dist/docx/save-modified.d.ts +2 -1
  204. package/dist/docx/save-modified.d.ts.map +1 -1
  205. package/dist/docx/save.d.ts.map +1 -1
  206. package/dist/docx/style-ref-fields.d.ts +1 -8
  207. package/dist/docx/style-ref-fields.d.ts.map +1 -1
  208. package/dist/docx/symbol-field.d.ts +21 -0
  209. package/dist/docx/symbol-field.d.ts.map +1 -0
  210. package/dist/docx/table-cell-write.d.ts.map +1 -1
  211. package/dist/docx/table-defaults.d.ts +2 -0
  212. package/dist/docx/table-defaults.d.ts.map +1 -1
  213. package/dist/docx/table-margins.d.ts +18 -0
  214. package/dist/docx/table-margins.d.ts.map +1 -0
  215. package/dist/docx/table-model.d.ts +23 -0
  216. package/dist/docx/table-model.d.ts.map +1 -1
  217. package/dist/docx/table-structure-check.d.ts.map +1 -1
  218. package/dist/docx/table-styles.d.ts.map +1 -1
  219. package/dist/docx/ui/index.cjs +787 -435
  220. package/dist/docx/ui/index.d.ts +1 -0
  221. package/dist/docx/ui/index.d.ts.map +1 -1
  222. package/dist/docx/ui/index.mjs +784 -436
  223. package/dist/docx/ui/inline-content-schema.d.ts.map +1 -1
  224. package/dist/docx/ui/paragraph-attributes.d.ts +6 -0
  225. package/dist/docx/ui/paragraph-attributes.d.ts.map +1 -1
  226. package/dist/docx/ui/ribbon-action-ids.d.ts +1 -1
  227. package/dist/docx/ui/ribbon-action-ids.d.ts.map +1 -1
  228. package/dist/docx/ui/ribbon-legacy-labels.d.ts +1 -1
  229. package/dist/docx/ui/ribbon-legacy-labels.d.ts.map +1 -1
  230. package/dist/docx/ui/run-adapter.d.ts.map +1 -1
  231. package/dist/docx/ui/schema-marks.d.ts +2 -19
  232. package/dist/docx/ui/schema-marks.d.ts.map +1 -1
  233. package/dist/docx/ui/track-run-formatting.d.ts.map +1 -1
  234. package/dist/docx/ui/yjs-document-attributes.d.ts +5 -0
  235. package/dist/docx/ui/yjs-document-attributes.d.ts.map +1 -1
  236. package/dist/docx/write-drawing-wrap.d.ts +22 -0
  237. package/dist/docx/write-drawing-wrap.d.ts.map +1 -0
  238. package/dist/docx/write-drawing.d.ts.map +1 -1
  239. package/dist/docx/write-revisions.d.ts +3 -1
  240. package/dist/docx/write-revisions.d.ts.map +1 -1
  241. package/dist/docx/write-shape.d.ts.map +1 -1
  242. package/dist/docx/write-table-properties.d.ts.map +1 -1
  243. package/dist/docx/write.d.ts.map +1 -1
  244. package/dist/drawingml/html-text-paste.d.ts +28 -0
  245. package/dist/drawingml/html-text-paste.d.ts.map +1 -0
  246. package/dist/drawingml/html-text-style.d.ts +18 -0
  247. package/dist/drawingml/html-text-style.d.ts.map +1 -0
  248. package/dist/drawingml/index.cjs +762 -0
  249. package/dist/drawingml/index.d.ts +1 -0
  250. package/dist/drawingml/index.d.ts.map +1 -1
  251. package/dist/drawingml/index.mjs +760 -1
  252. package/dist/index.cjs +1237 -285
  253. package/dist/index.mjs +1237 -285
  254. package/dist/pptx/automation/index.cjs +561 -180
  255. package/dist/pptx/automation/index.d.ts +4 -4
  256. package/dist/pptx/automation/index.mjs +6 -5
  257. package/dist/pptx/chunks/{index-BCy58n13.d.ts → index-8ZfPndYR.d.ts} +2 -2
  258. package/dist/pptx/chunks/{index-BCy58n13.d.ts.map → index-8ZfPndYR.d.ts.map} +1 -1
  259. package/dist/pptx/chunks/{index-OwiX5IVw.d.ts → index-DVhD9Kd5.d.ts} +4 -4
  260. package/dist/pptx/chunks/{index-OwiX5IVw.d.ts.map → index-DVhD9Kd5.d.ts.map} +1 -1
  261. package/dist/pptx/chunks/{index-oQHWAO7M.d.ts → index-DsUnUj-V.d.ts} +5 -5
  262. package/dist/pptx/chunks/{index-oQHWAO7M.d.ts.map → index-DsUnUj-V.d.ts.map} +1 -1
  263. package/dist/pptx/chunks/{index-AZN38e6S.d.ts → index-xB7MDLI7.d.ts} +4 -4
  264. package/dist/pptx/chunks/{index-AZN38e6S.d.ts.map → index-xB7MDLI7.d.ts.map} +1 -1
  265. package/dist/pptx/chunks/{presentation-DOaYIW-l.d.ts → presentation-BvnVkFPJ.d.ts} +26 -2
  266. package/dist/pptx/chunks/{presentation-DOaYIW-l.d.ts.map → presentation-BvnVkFPJ.d.ts.map} +1 -1
  267. package/dist/pptx/chunks/{text-operations-CYSXno9L.d.ts → text-operations-D7TCPhlv.d.ts} +2 -2
  268. package/dist/pptx/chunks/{text-operations-CYSXno9L.d.ts.map → text-operations-D7TCPhlv.d.ts.map} +1 -1
  269. package/dist/pptx/cli/index.cjs +504 -124
  270. package/dist/pptx/cli/index.d.ts +1 -1
  271. package/dist/pptx/cli/index.mjs +4 -4
  272. package/dist/pptx/converter/index.d.ts +1 -1
  273. package/dist/pptx/converter/index.mjs +2 -2
  274. package/dist/pptx/editor/render/custom-show-operations.cjs +2 -2
  275. package/dist/pptx/editor/render/custom-show-operations.mjs +1 -1
  276. package/dist/pptx/editor/render/find-replace.cjs +16 -15
  277. package/dist/pptx/editor/render/find-replace.d.ts +2 -2
  278. package/dist/pptx/editor/render/find-replace.mjs +3 -2
  279. package/dist/pptx/editor/render/font-family-update.d.ts +2 -2
  280. package/dist/pptx/editor/render/paragraph-geometry-overrides.d.ts +2 -2
  281. package/dist/pptx/editor/render/segments-text-edit.cjs +159 -0
  282. package/dist/pptx/editor/render/segments-text-edit.d.ts +26 -0
  283. package/dist/pptx/editor/render/segments-text-edit.d.ts.map +1 -0
  284. package/dist/pptx/editor/render/segments-text-edit.mjs +156 -0
  285. package/dist/pptx/editor/render/slide-operations.cjs +12 -9
  286. package/dist/pptx/editor/render/slide-operations.mjs +6 -3
  287. package/dist/pptx/editor/render/table-cell-edit.cjs +5 -5
  288. package/dist/pptx/editor/render/table-cell-edit.d.ts.map +1 -1
  289. package/dist/pptx/editor/render/table-cell-edit.mjs +1 -1
  290. package/dist/pptx/editor/render/table-cell-merge.cjs +3 -3
  291. package/dist/pptx/editor/render/table-cell-merge.mjs +1 -1
  292. package/dist/pptx/editor/render/table-cell-rich-text.cjs +41 -0
  293. package/dist/pptx/editor/render/table-cell-rich-text.d.ts +50 -0
  294. package/dist/pptx/editor/render/table-cell-rich-text.d.ts.map +1 -0
  295. package/dist/pptx/editor/render/table-cell-rich-text.mjs +8 -0
  296. package/dist/pptx/editor/render/table-cell-source.cjs +23 -0
  297. package/dist/pptx/editor/render/table-cell-source.d.ts +31 -0
  298. package/dist/pptx/editor/render/table-cell-source.d.ts.map +1 -0
  299. package/dist/pptx/editor/render/table-cell-source.mjs +6 -0
  300. package/dist/pptx/editor/render/table-cells-text-style.cjs +116 -0
  301. package/dist/pptx/editor/render/table-cells-text-style.d.ts +37 -0
  302. package/dist/pptx/editor/render/table-cells-text-style.d.ts.map +1 -0
  303. package/dist/pptx/editor/render/table-cells-text-style.mjs +113 -0
  304. package/dist/pptx/editor/render/table-data-grid-ops.cjs +40 -94
  305. package/dist/pptx/editor/render/table-data-grid-ops.mjs +3 -88
  306. package/dist/pptx/editor/render/table-grid-fill.cjs +30 -0
  307. package/dist/pptx/editor/render/table-grid-fill.d.ts +34 -0
  308. package/dist/pptx/editor/render/table-grid-fill.d.ts.map +1 -0
  309. package/dist/pptx/editor/render/table-grid-fill.mjs +28 -0
  310. package/dist/pptx/editor/render/table-layout.cjs +6 -6
  311. package/dist/pptx/editor/render/table-layout.d.ts +2 -2
  312. package/dist/pptx/editor/render/table-layout.d.ts.map +1 -1
  313. package/dist/pptx/editor/render/table-layout.mjs +1 -1
  314. package/dist/pptx/editor/render/table-merge.cjs +5 -5
  315. package/dist/pptx/editor/render/table-merge.mjs +1 -1
  316. package/dist/pptx/editor/render/text-content-style.d.ts +2 -2
  317. package/dist/pptx/editor/render/text-runs-style-patch.d.ts +2 -2
  318. package/dist/pptx/editor/render/text-style-scope.d.ts +2 -2
  319. package/dist/pptx/editor/render/update-text-segment-style.d.ts +2 -2
  320. package/dist/pptx/index.cjs +519 -201
  321. package/dist/pptx/index.d.ts +7 -7
  322. package/dist/pptx/index.mjs +5 -5
  323. package/dist/pptx/node/index.d.ts +1 -1
  324. package/dist/pptx/smartart-layouts/index.d.ts +2 -2
  325. package/dist/teams/index.cjs +35 -25
  326. package/dist/teams/index.mjs +35 -25
  327. package/dist/text/complex-breaks.d.ts +24 -0
  328. package/dist/text/complex-breaks.d.ts.map +1 -0
  329. package/dist/text/east-asian.d.ts +32 -0
  330. package/dist/text/east-asian.d.ts.map +1 -0
  331. package/dist/text/html-tokens.d.ts +45 -0
  332. package/dist/text/html-tokens.d.ts.map +1 -0
  333. package/dist/text/index.cjs +567 -96
  334. package/dist/text/index.d.ts +6 -0
  335. package/dist/text/index.d.ts.map +1 -1
  336. package/dist/text/index.mjs +544 -97
  337. package/dist/text/kinsoku.d.ts +55 -0
  338. package/dist/text/kinsoku.d.ts.map +1 -0
  339. package/dist/text/truetype/embedding.d.ts +42 -0
  340. package/dist/text/truetype/embedding.d.ts.map +1 -0
  341. package/dist/text/truetype/glyphless.d.ts +5 -0
  342. package/dist/text/truetype/glyphless.d.ts.map +1 -0
  343. package/dist/text/truetype/sfnt-write.d.ts +10 -0
  344. package/dist/text/truetype/sfnt-write.d.ts.map +1 -0
  345. package/dist/text/truetype/subset.d.ts.map +1 -1
  346. package/dist/text/windows-1252.d.ts +10 -0
  347. package/dist/text/windows-1252.d.ts.map +1 -0
  348. package/dist/xlsx/collab/index.cjs +10 -6
  349. package/dist/xlsx/collab/index.mjs +10 -6
  350. package/dist/xlsx/edit/clipboard-html-parse.d.ts +1 -0
  351. package/dist/xlsx/edit/clipboard-html-parse.d.ts.map +1 -1
  352. package/dist/xlsx/formula/functions/text-convert.d.ts.map +1 -1
  353. package/dist/xlsx/index.cjs +96 -51
  354. package/dist/xlsx/index.mjs +96 -51
  355. package/dist/xlsx/load/index.cjs +10 -6
  356. package/dist/xlsx/load/index.mjs +10 -6
  357. package/dist/xlsx/ui/index.cjs +97 -52
  358. package/dist/xlsx/ui/index.mjs +97 -52
  359. package/package.json +1 -1
  360. package/dist/PptxHandler-72NTA5ZY.cjs +0 -14
  361. package/dist/PptxHandler-O4IJ3TKZ.mjs +0 -5
  362. package/dist/PresentationBuilder-ORM22QGC.mjs +0 -5
  363. package/dist/PresentationBuilder-T2ETYT3L.cjs +0 -22
  364. package/dist/chunk-X4RL5AZ7.cjs +0 -120
  365. package/dist/{chunk-PRGXRAAU.mjs → chunk-4Y76EAKK.mjs} +131 -131
  366. package/dist/{chunk-EN3KSEW5.cjs → chunk-MMULWQOM.cjs} +131 -131
package/dist/index.cjs CHANGED
@@ -1827,10 +1827,10 @@ function squarify(nodes, box) {
1827
1827
  const result = [];
1828
1828
  let rect3 = { ...box };
1829
1829
  let remaining = items;
1830
- for (let first2 = remaining[0]; first2 !== void 0; first2 = remaining[0]) {
1830
+ for (let first3 = remaining[0]; first3 !== void 0; first3 = remaining[0]) {
1831
1831
  const side = Math.min(rect3.w, rect3.h);
1832
- let row2 = [first2];
1833
- let rowAreas = [first2.area];
1832
+ let row2 = [first3];
1833
+ let rowAreas = [first3.area];
1834
1834
  let worst = worstAspectRatio(rowAreas, side);
1835
1835
  let cursor = 1;
1836
1836
  for (let next = remaining[cursor]; next !== void 0; next = remaining[cursor]) {
@@ -5361,10 +5361,10 @@ function lerpStops(a2, b, t) {
5361
5361
  };
5362
5362
  }
5363
5363
  function gradientColorAt(stops, position) {
5364
- const first2 = stops[0];
5364
+ const first3 = stops[0];
5365
5365
  const last = stops[stops.length - 1];
5366
- if (position <= first2.position) {
5367
- return { color: first2.color, opacity: first2.opacity ?? 1 };
5366
+ if (position <= first3.position) {
5367
+ return { color: first3.color, opacity: first3.opacity ?? 1 };
5368
5368
  }
5369
5369
  if (position >= last.position) {
5370
5370
  return { color: last.color, opacity: last.opacity ?? 1 };
@@ -5476,8 +5476,8 @@ function buildRectPathGradientExactSvg(stops, focalPoint, fillToRect) {
5476
5476
  const pairs = [0, 2, 4, 6].map((i2) => `${points2[i2]},${points2[i2 + 1]}`).join(" ");
5477
5477
  return `<polygon points="${pairs}" fill="url(#${side.id})"/>`;
5478
5478
  }).join("");
5479
- const first2 = sorted[0];
5480
- const plateau = right - left > 1e-3 && bottom - top > 1e-3 ? `<rect x="${n3(left)}" y="${n3(top)}" width="${n3(right - left)}" height="${n3(bottom - top)}" fill="${first2.color}"${alpha(first2.opacity, "fill-opacity")}/>` : "";
5479
+ const first3 = sorted[0];
5480
+ const plateau = right - left > 1e-3 && bottom - top > 1e-3 ? `<rect x="${n3(left)}" y="${n3(top)}" width="${n3(right - left)}" height="${n3(bottom - top)}" fill="${first3.color}"${alpha(first3.opacity, "fill-opacity")}/>` : "";
5481
5481
  return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none" shape-rendering="crispEdges"><defs>${defs}</defs>${polygons}${plateau}</svg>`;
5482
5482
  }
5483
5483
  function buildRectPathGradientImage(stops, focalPoint, fillToRect) {
@@ -8452,13 +8452,13 @@ function distributeRunsText(oldTexts, newText) {
8452
8452
  return result;
8453
8453
  }
8454
8454
  function realignOrCollapseRuns(runs, text3) {
8455
- const first2 = runs[0];
8456
- if (!first2) return [];
8455
+ const first3 = runs[0];
8456
+ if (!first3) return [];
8457
8457
  const distributed = distributeRunsText(
8458
8458
  runs.map((run2) => run2.text),
8459
8459
  text3
8460
8460
  );
8461
- return distributed ? runs.map((run2, index) => ({ ...run2, text: distributed[index] ?? "" })) : [{ ...first2, text: text3 }];
8461
+ return distributed ? runs.map((run2, index) => ({ ...run2, text: distributed[index] ?? "" })) : [{ ...first3, text: text3 }];
8462
8462
  }
8463
8463
 
8464
8464
  // chart/edit/title-realign.ts
@@ -8510,9 +8510,9 @@ function retextChartTextBody(body, text3) {
8510
8510
  { label: "Chart title" }
8511
8511
  ).documentElement;
8512
8512
  const runs = [...root.getElementsByTagNameNS(NS.a, "r")];
8513
- const first2 = runs[0]?.getElementsByTagNameNS(NS.a, "t")[0];
8514
- if (!first2) return void 0;
8515
- first2.textContent = text3;
8513
+ const first3 = runs[0]?.getElementsByTagNameNS(NS.a, "t")[0];
8514
+ if (!first3) return void 0;
8515
+ first3.textContent = text3;
8516
8516
  for (const run3 of runs.slice(1)) run3.parentNode?.removeChild(run3);
8517
8517
  return chartTextBodyFromXml(innerXml(root));
8518
8518
  }
@@ -9123,8 +9123,8 @@ function seriesWithKeys(space3) {
9123
9123
  }
9124
9124
  function standardChartLayoutSheet(space3, categoryCount) {
9125
9125
  const entries = seriesWithKeys(space3);
9126
- const first2 = entries[0]?.series[entries[0].val]?.formula;
9127
- const sheet = first2 ? parseChartFormulaRange(first2)?.sheetName : void 0;
9126
+ const first3 = entries[0]?.series[entries[0].val]?.formula;
9127
+ const sheet = first3 ? parseChartFormulaRange(first3)?.sheetName : void 0;
9128
9128
  if (!sheet) return void 0;
9129
9129
  const standard = entries.every(({ series: series2, cat, val: val2 }, index) => {
9130
9130
  const expected = standardChartFormulas(sheet, index, categoryCount);
@@ -9179,9 +9179,9 @@ function dimensionWrites(dimension2, resolve) {
9179
9179
  col: horizontal ? range2.end.col : start.col,
9180
9180
  row: horizontal ? start.row : range2.end.row
9181
9181
  };
9182
- const first2 = absolute2(start.col, start.row), last = absolute2(end.col, end.row);
9182
+ const first3 = absolute2(start.col, start.row), last = absolute2(end.col, end.row);
9183
9183
  return {
9184
- formula: `${quoteChartSheetName(range2.sheetName)}!${first2 === last ? first2 : `${first2}:${last}`}`,
9184
+ formula: `${quoteChartSheetName(range2.sheetName)}!${first3 === last ? first3 : `${first3}:${last}`}`,
9185
9185
  isNumeric: dimension2.kind === "numDim",
9186
9186
  values
9187
9187
  };
@@ -9307,10 +9307,10 @@ function chartExDataLayout(space3, sheetName) {
9307
9307
  columns.push([level4.name ?? `Data ${columns.length + 1}`, ...data2]);
9308
9308
  }
9309
9309
  if (!count2) throw new Error("ChartEx source has no data points.");
9310
- const first2 = ref(start, count2).split(":")[0];
9310
+ const first3 = ref(start, count2).split(":")[0];
9311
9311
  const last = ref(columns.length - 1, count2).split(":")[1];
9312
9312
  dimension2.formula = {
9313
- formula: `${first2}:${last}`,
9313
+ formula: `${first3}:${last}`,
9314
9314
  ...dimension2.formula?.direction ? { direction: "col" } : {}
9315
9315
  };
9316
9316
  }
@@ -10545,9 +10545,9 @@ function stockStyle(group2) {
10545
10545
  };
10546
10546
  }
10547
10547
  function extraGroups(chartSpace, firstType) {
10548
- const [first2, ...rest] = chartSpace.plotArea.groups;
10549
- if (!first2 || !["column", "line", "area"].includes(firstType)) return [];
10550
- const primary = valueAxisId(chartSpace, first2.axisIds);
10548
+ const [first3, ...rest] = chartSpace.plotArea.groups;
10549
+ if (!first3 || !["column", "line", "area"].includes(firstType)) return [];
10550
+ const primary = valueAxisId(chartSpace, first3.axisIds);
10551
10551
  const out = [];
10552
10552
  for (const group2 of rest) {
10553
10553
  const stockOverColumns = group2.kind === "stock" && firstType === "column";
@@ -12909,10 +12909,10 @@ function generateIntervalTicks(range2, unit) {
12909
12909
  return [];
12910
12910
  }
12911
12911
  const tolerance = Math.max(1, Math.abs(range2.min), Math.abs(range2.max)) * 1e-12;
12912
- const first2 = Math.ceil((range2.min - tolerance) / unit);
12912
+ const first3 = Math.ceil((range2.min - tolerance) / unit);
12913
12913
  const last = Math.floor((range2.max + tolerance) / unit);
12914
- const count = Math.min(Math.max(last - first2 + 1, 0), 2e3);
12915
- return Array.from({ length: count }, (_, index) => (first2 + index) * unit);
12914
+ const count = Math.min(Math.max(last - first3 + 1, 0), 2e3);
12915
+ return Array.from({ length: count }, (_, index) => (first3 + index) * unit);
12916
12916
  }
12917
12917
  function generateAxisTicks(range2, axis2, defaultIntervals) {
12918
12918
  if (range2.logScale && range2.logBase) {
@@ -13046,6 +13046,7 @@ var drawingml_exports = {};
13046
13046
  __export(drawingml_exports, {
13047
13047
  ARTISTIC_PRIMARY_ATTRIBUTE: () => ARTISTIC_PRIMARY_ATTRIBUTE,
13048
13048
  BODY_PROPERTIES_ORDER: () => BODY_PROPERTIES_ORDER,
13049
+ DEFAULT_HTML_TEXT_PASTE_LIMITS: () => DEFAULT_HTML_TEXT_PASTE_LIMITS,
13049
13050
  DEFAULT_THEME_COLOR_MAP: () => DEFAULT_THEME_COLOR_MAP,
13050
13051
  DOM_3D_READER: () => DOM_3D_READER,
13051
13052
  OFFICE_GRADIENT_PRESETS: () => OFFICE_GRADIENT_PRESETS,
@@ -13083,6 +13084,7 @@ __export(drawingml_exports, {
13083
13084
  drawingLineXml: () => drawingLineXml,
13084
13085
  drawingParagraphPropertiesXml: () => drawingParagraphPropertiesXml,
13085
13086
  drawingParagraphText: () => drawingParagraphText,
13087
+ drawingParagraphsText: () => drawingParagraphsText,
13086
13088
  drawingPathData: () => drawingPathData,
13087
13089
  drawingRichTextBodyXml: () => drawingRichTextBodyXml,
13088
13090
  drawingRunPropertiesXml: () => drawingRunPropertiesXml,
@@ -13090,6 +13092,7 @@ __export(drawingml_exports, {
13090
13092
  drawingThemeXml: () => drawingThemeXml,
13091
13093
  fillElementOf: () => fillElementOf,
13092
13094
  gradientColorAt: () => gradientColorAt,
13095
+ htmlToDrawingParagraphs: () => htmlToDrawingParagraphs,
13093
13096
  imageContentType: () => imageContentType,
13094
13097
  inspectRasterImage: () => inspectRasterImage,
13095
13098
  integerAttribute: () => integerAttribute,
@@ -15765,6 +15768,776 @@ function capCompensatedDashArray(pattern, strokeWidth, lineCap) {
15765
15768
  return out.map((n3) => Number(n3.toFixed(4))).join(" ");
15766
15769
  }
15767
15770
 
15771
+ // opc/safe-href.ts
15772
+ var SAFE_SCHEMES = /* @__PURE__ */ new Set(["http:", "https:", "mailto:"]);
15773
+ function isSafeHyperlinkHref(href) {
15774
+ const scheme2 = /^([a-z][a-z0-9+.-]*:)/i.exec(href.trim())?.[1];
15775
+ return scheme2 !== void 0 && SAFE_SCHEMES.has(scheme2.toLowerCase());
15776
+ }
15777
+ var OPEN_SCHEMES = /* @__PURE__ */ new Set(["http", "https", "mailto"]);
15778
+ var STORE_SCHEMES = /* @__PURE__ */ new Set([...OPEN_SCHEMES, "ftp", "file"]);
15779
+ var SCRIPT_SCHEMES = /* @__PURE__ */ new Set([
15780
+ "javascript",
15781
+ "vbscript",
15782
+ "livescript",
15783
+ "jscript",
15784
+ "mocha",
15785
+ "data",
15786
+ "mhtml",
15787
+ "ms-its",
15788
+ "mk",
15789
+ "x-javascript",
15790
+ "blob"
15791
+ ]);
15792
+ var IGNORABLE = new RegExp(
15793
+ "[\\u0000-\\u0020\\u007f\\u00ad\\u200b-\\u200f\\u202a-\\u202e\\u2060-\\u2064\\ufeff]",
15794
+ "gu"
15795
+ );
15796
+ var CONTROL = new RegExp("[\\u0000-\\u001f\\u007f]", "u");
15797
+ var SCHEME = /^([a-z][a-z0-9+.-]*):/;
15798
+ var STORE_ONLY = { store: true, open: false, reason: "not-openable" };
15799
+ var reject = (reason) => ({
15800
+ store: false,
15801
+ open: false,
15802
+ reason
15803
+ });
15804
+ function hyperlinkPolicy(href, options2 = {}) {
15805
+ if (typeof href !== "string") return reject("empty");
15806
+ const trimmed = href.trim();
15807
+ const normalized = trimmed.replace(IGNORABLE, "").toLowerCase();
15808
+ if (normalized.length === 0) return reject("empty");
15809
+ const scheme2 = SCHEME.exec(normalized)?.[1];
15810
+ if (scheme2 !== void 0 && SCRIPT_SCHEMES.has(scheme2)) return reject("script-scheme");
15811
+ if (scheme2 !== void 0 && !trimmed.toLowerCase().startsWith(`${scheme2}:`))
15812
+ return reject("obfuscated-scheme");
15813
+ if (CONTROL.test(trimmed)) return reject("control-characters");
15814
+ if (scheme2 === void 0) return options2.openRelative ? { store: true, open: true } : STORE_ONLY;
15815
+ if (scheme2.length === 1) return STORE_ONLY;
15816
+ if (OPEN_SCHEMES.has(scheme2)) return { store: true, open: true };
15817
+ if (options2.additionalOpenSchemes?.some((allowed) => allowed.toLowerCase() === scheme2))
15818
+ return { store: true, open: true };
15819
+ if (STORE_SCHEMES.has(scheme2)) return STORE_ONLY;
15820
+ return reject("unsupported-scheme");
15821
+ }
15822
+ function isStorableHyperlinkHref(href, options2) {
15823
+ return hyperlinkPolicy(href, options2).store;
15824
+ }
15825
+ function isOpenableHyperlinkHref(href, options2) {
15826
+ return hyperlinkPolicy(href, options2).open;
15827
+ }
15828
+
15829
+ // text/html-tokens.ts
15830
+ var ENTITIES2 = {
15831
+ amp: "&",
15832
+ lt: "<",
15833
+ gt: ">",
15834
+ quot: '"',
15835
+ apos: "'",
15836
+ nbsp: "\xA0",
15837
+ ensp: "\u2002",
15838
+ emsp: "\u2003",
15839
+ thinsp: "\u2009",
15840
+ ndash: "\u2013",
15841
+ mdash: "\u2014",
15842
+ lsquo: "\u2018",
15843
+ rsquo: "\u2019",
15844
+ ldquo: "\u201C",
15845
+ rdquo: "\u201D",
15846
+ bull: "\u2022",
15847
+ hellip: "\u2026",
15848
+ copy: "\xA9",
15849
+ reg: "\xAE",
15850
+ trade: "\u2122",
15851
+ euro: "\u20AC"
15852
+ };
15853
+ function codePoint(value) {
15854
+ if (!Number.isFinite(value) || value <= 0 || value > 1114111) return "\uFFFD";
15855
+ if (value >= 55296 && value <= 57343) return "\uFFFD";
15856
+ return String.fromCodePoint(value);
15857
+ }
15858
+ function decodeHtmlEntities(text3) {
15859
+ return text3.replace(/&(#x[0-9a-f]{1,8}|#\d{1,10}|[a-z]{1,10});/gi, (whole, name2) => {
15860
+ if (name2[1] === "x" || name2[1] === "X") return codePoint(parseInt(name2.slice(2), 16));
15861
+ if (name2.startsWith("#")) return codePoint(Number(name2.slice(1)));
15862
+ return ENTITIES2[name2.toLowerCase()] ?? whole;
15863
+ });
15864
+ }
15865
+ function parseHtmlAttributes(text3) {
15866
+ const attrs2 = /* @__PURE__ */ new Map();
15867
+ for (const m of text3.matchAll(
15868
+ /([\w:-]{1,64})\s{0,16}=\s{0,16}(?:"([^"]*)"|'([^']*)'|([^\s>]+))/g
15869
+ ))
15870
+ attrs2.set((m[1] ?? "").toLowerCase(), decodeHtmlEntities(m[2] ?? m[3] ?? m[4] ?? ""));
15871
+ return attrs2;
15872
+ }
15873
+ function parseCssDeclarations(text3) {
15874
+ const out = /* @__PURE__ */ new Map();
15875
+ for (const decl of text3.split(";")) {
15876
+ const colon = decl.indexOf(":");
15877
+ if (colon < 0) continue;
15878
+ out.set(
15879
+ decl.slice(0, colon).trim().toLowerCase(),
15880
+ decl.slice(colon + 1).replace(/!important/gi, "").trim()
15881
+ );
15882
+ }
15883
+ return out;
15884
+ }
15885
+ var NAMED_COLORS2 = {
15886
+ black: "000000",
15887
+ white: "FFFFFF",
15888
+ red: "FF0000",
15889
+ green: "008000",
15890
+ lime: "00FF00",
15891
+ blue: "0000FF",
15892
+ yellow: "FFFF00",
15893
+ orange: "FFA500",
15894
+ purple: "800080",
15895
+ gray: "808080",
15896
+ grey: "808080",
15897
+ silver: "C0C0C0",
15898
+ navy: "000080",
15899
+ maroon: "800000",
15900
+ teal: "008080",
15901
+ olive: "808000",
15902
+ aqua: "00FFFF",
15903
+ cyan: "00FFFF",
15904
+ fuchsia: "FF00FF",
15905
+ magenta: "FF00FF",
15906
+ darkblue: "00008B",
15907
+ darkred: "8B0000",
15908
+ darkgreen: "006400",
15909
+ darkcyan: "008B8B",
15910
+ darkmagenta: "8B008B",
15911
+ darkgray: "A9A9A9",
15912
+ darkgrey: "A9A9A9",
15913
+ lightgray: "D3D3D3",
15914
+ lightgrey: "D3D3D3",
15915
+ darkyellow: "808000"
15916
+ };
15917
+ function parseCssColorHex(text3) {
15918
+ const value = text3.trim().toLowerCase();
15919
+ const hex = /^#([0-9a-f]{3}|[0-9a-f]{6})$/.exec(value)?.[1];
15920
+ if (hex) return (hex.length === 3 ? [...hex].map((ch) => ch + ch).join("") : hex).toUpperCase();
15921
+ const rgb = /^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*([\d.]+))?/.exec(value);
15922
+ if (rgb) {
15923
+ if (rgb[4] !== void 0 && Number(rgb[4]) === 0) return void 0;
15924
+ return rgb.slice(1, 4).map((n3) => Math.min(255, Number(n3)).toString(16).padStart(2, "0")).join("").toUpperCase();
15925
+ }
15926
+ return NAMED_COLORS2[value];
15927
+ }
15928
+ var MAX_TAG_LENGTH = 8192;
15929
+ var RAW_TEXT = /* @__PURE__ */ new Set([
15930
+ "script",
15931
+ "style",
15932
+ "textarea",
15933
+ "title",
15934
+ "xmp",
15935
+ "noscript",
15936
+ "template",
15937
+ "head",
15938
+ "xml",
15939
+ "svg",
15940
+ "math",
15941
+ "iframe",
15942
+ "object",
15943
+ "canvas",
15944
+ "select"
15945
+ ]);
15946
+ function htmlClipboardFragment(html) {
15947
+ const start = html.indexOf("<!--StartFragment-->");
15948
+ const end = html.indexOf("<!--EndFragment-->", start < 0 ? 0 : start);
15949
+ if (start >= 0 && end > start) return html.slice(start + "<!--StartFragment-->".length, end);
15950
+ const first3 = html.indexOf("<");
15951
+ return first3 > 0 && /^Version:\d/.test(html) ? html.slice(first3) : html;
15952
+ }
15953
+ function tagEnd(html, from) {
15954
+ let quote = "";
15955
+ const limit = Math.min(html.length, from + MAX_TAG_LENGTH);
15956
+ for (let i2 = from; i2 < limit; i2++) {
15957
+ const ch = html[i2];
15958
+ if (quote) {
15959
+ if (ch === quote) quote = "";
15960
+ } else if (ch === '"' || ch === "'") quote = ch;
15961
+ else if (ch === ">") return i2;
15962
+ else if (ch === "<") return -1;
15963
+ }
15964
+ return -1;
15965
+ }
15966
+ function tokenizeHtml(html, maxTokens = Number.POSITIVE_INFINITY) {
15967
+ const tokens = [];
15968
+ let text3 = "";
15969
+ const flush = () => {
15970
+ if (text3) tokens.push({ kind: "text", text: decodeHtmlEntities(text3) });
15971
+ text3 = "";
15972
+ };
15973
+ let i2 = 0;
15974
+ while (i2 < html.length) {
15975
+ if (tokens.length >= maxTokens) {
15976
+ text3 += textWithoutTags(html.slice(i2));
15977
+ break;
15978
+ }
15979
+ const lt = html.indexOf("<", i2);
15980
+ if (lt < 0) {
15981
+ text3 += html.slice(i2);
15982
+ break;
15983
+ }
15984
+ text3 += html.slice(i2, lt);
15985
+ i2 = lt;
15986
+ if (html.startsWith("<!--", i2)) {
15987
+ const close = html.indexOf("-->", i2 + 4);
15988
+ i2 = close < 0 ? html.length : close + 3;
15989
+ continue;
15990
+ }
15991
+ if (html.startsWith("<![", i2)) {
15992
+ const close = html.indexOf("]>", i2 + 3);
15993
+ const body = html.slice(i2 + 3, close < 0 ? html.length : close).toLowerCase();
15994
+ flush();
15995
+ if (/^\s*if\b/.test(body))
15996
+ tokens.push({
15997
+ kind: "conditional",
15998
+ open: true,
15999
+ supportLists: body.includes("supportlists")
16000
+ });
16001
+ else if (/^\s*endif\b/.test(body))
16002
+ tokens.push({ kind: "conditional", open: false, supportLists: false });
16003
+ i2 = close < 0 ? html.length : close + 2;
16004
+ continue;
16005
+ }
16006
+ const next = html[i2 + 1] ?? "";
16007
+ if (next === "!" || next === "?") {
16008
+ const close = html.indexOf(">", i2 + 2);
16009
+ i2 = close < 0 ? html.length : close + 1;
16010
+ continue;
16011
+ }
16012
+ const closing = next === "/";
16013
+ const nameMatch = /^[a-zA-Z][\w:-]{0,63}/.exec(html.slice(i2 + (closing ? 2 : 1), i2 + 70));
16014
+ const end = nameMatch ? tagEnd(html, i2 + 1) : -1;
16015
+ if (!nameMatch || end < 0) {
16016
+ text3 += "<";
16017
+ i2 += 1;
16018
+ continue;
16019
+ }
16020
+ const name2 = nameMatch[0].toLowerCase();
16021
+ flush();
16022
+ if (closing) {
16023
+ tokens.push({ kind: "close", name: name2 });
16024
+ i2 = end + 1;
16025
+ continue;
16026
+ }
16027
+ const inner = html.slice(i2 + 1 + nameMatch[0].length, end);
16028
+ const selfClosing = inner.trimEnd().endsWith("/");
16029
+ i2 = end + 1;
16030
+ if (RAW_TEXT.has(name2)) {
16031
+ tokens.push({ kind: "text", text: "" });
16032
+ if (selfClosing) continue;
16033
+ const closer = new RegExp(`</${name2}`, "gi");
16034
+ closer.lastIndex = i2;
16035
+ const found = closer.exec(html);
16036
+ const after = found ? html.indexOf(">", found.index) : -1;
16037
+ i2 = after < 0 ? html.length : after + 1;
16038
+ continue;
16039
+ }
16040
+ tokens.push({ kind: "open", name: name2, attrs: parseHtmlAttributes(inner), selfClosing });
16041
+ }
16042
+ flush();
16043
+ return tokens;
16044
+ }
16045
+ function textWithoutTags(html) {
16046
+ let out = "";
16047
+ let at2 = 0;
16048
+ for (let lt = html.indexOf("<"); lt >= 0; lt = html.indexOf("<", at2)) {
16049
+ const gt = html.indexOf(">", lt + 1);
16050
+ if (gt < 0) break;
16051
+ const inner = html.indexOf("<", lt + 1);
16052
+ if (inner >= 0 && inner < gt) {
16053
+ out += html.slice(at2, inner);
16054
+ at2 = inner;
16055
+ continue;
16056
+ }
16057
+ out += html.slice(at2, lt);
16058
+ at2 = gt + 1;
16059
+ }
16060
+ return out + html.slice(at2);
16061
+ }
16062
+
16063
+ // drawingml/html-text-style.ts
16064
+ var srgb = (value) => ({ kind: "srgb", value, transforms: [] });
16065
+ var GENERIC_FAMILIES = /* @__PURE__ */ new Set([
16066
+ "serif",
16067
+ "sans-serif",
16068
+ "monospace",
16069
+ "cursive",
16070
+ "fantasy",
16071
+ "system-ui",
16072
+ "inherit",
16073
+ "initial",
16074
+ "unset"
16075
+ ]);
16076
+ function cssFirstFontFamily(value) {
16077
+ for (const part of value.split(",")) {
16078
+ const name2 = part.trim().replace(/^["']|["']$/g, "");
16079
+ if (name2 && name2.length <= 64 && !GENERIC_FAMILIES.has(name2.toLowerCase())) return name2;
16080
+ }
16081
+ return void 0;
16082
+ }
16083
+ function cssFontSizePt(value) {
16084
+ const keyword = {
16085
+ "xx-small": 7,
16086
+ "x-small": 7.5,
16087
+ small: 10,
16088
+ medium: 12,
16089
+ large: 13.5,
16090
+ "x-large": 18,
16091
+ "xx-large": 24
16092
+ };
16093
+ const v = value.trim().toLowerCase();
16094
+ if (keyword[v] !== void 0) return keyword[v];
16095
+ const m = /^(\d{1,4}(?:\.\d{1,3})?)(pt|px)$/.exec(v);
16096
+ if (!m) return void 0;
16097
+ const pt2 = Number(m[1]) * (m[2] === "px" ? 0.75 : 1);
16098
+ return pt2 >= 1 && pt2 <= 4e3 ? Math.round(pt2 * 100) / 100 : void 0;
16099
+ }
16100
+ var FONT_SIZE_ATTR = [7.5, 10, 12, 13.5, 18, 24, 36];
16101
+ function tagRunProperties(name2, attrs2) {
16102
+ switch (name2) {
16103
+ case "b":
16104
+ case "strong":
16105
+ return { bold: true };
16106
+ case "i":
16107
+ case "em":
16108
+ case "cite":
16109
+ case "dfn":
16110
+ return { italic: true };
16111
+ case "u":
16112
+ case "ins":
16113
+ return { underline: "sng" };
16114
+ case "s":
16115
+ case "strike":
16116
+ case "del":
16117
+ return { strike: "sngStrike" };
16118
+ case "sup":
16119
+ return { baseline: 0.3 };
16120
+ case "sub":
16121
+ return { baseline: -0.25 };
16122
+ case "mark":
16123
+ return { highlight: srgb("FFFF00") };
16124
+ case "code":
16125
+ case "kbd":
16126
+ case "samp":
16127
+ case "tt":
16128
+ case "pre":
16129
+ return { latin: { typeface: "Courier New" } };
16130
+ case "h1":
16131
+ return { bold: true, sizePt: 24 };
16132
+ case "h2":
16133
+ return { bold: true, sizePt: 18 };
16134
+ case "h3":
16135
+ return { bold: true, sizePt: 14 };
16136
+ case "h4":
16137
+ case "h5":
16138
+ case "h6":
16139
+ return { bold: true };
16140
+ case "font": {
16141
+ const props = {};
16142
+ const face = attrs2.get("face");
16143
+ const family = face ? cssFirstFontFamily(face) : void 0;
16144
+ if (family) props.latin = { typeface: family };
16145
+ const color2 = attrs2.get("color");
16146
+ const hex = color2 ? parseCssColorHex(color2) : void 0;
16147
+ if (hex) props.fill = { kind: "solid", color: srgb(hex) };
16148
+ const size = Number(attrs2.get("size"));
16149
+ const sizePt = Number.isInteger(size) ? FONT_SIZE_ATTR[size - 1] : void 0;
16150
+ if (sizePt !== void 0) props.sizePt = sizePt;
16151
+ return props;
16152
+ }
16153
+ default:
16154
+ return void 0;
16155
+ }
16156
+ }
16157
+ function cssRunProperties(style, inline) {
16158
+ const css = parseCssDeclarations(style);
16159
+ const props = {};
16160
+ const weight = css.get("font-weight");
16161
+ if (weight) props.bold = weight === "bold" || weight === "bolder" || Number(weight) >= 600;
16162
+ const fontStyle = css.get("font-style");
16163
+ if (fontStyle) props.italic = fontStyle === "italic" || fontStyle === "oblique";
16164
+ const decoration = css.get("text-decoration-line") ?? css.get("text-decoration");
16165
+ if (decoration) {
16166
+ if (decoration.includes("underline")) props.underline = "sng";
16167
+ if (decoration.includes("line-through")) props.strike = "sngStrike";
16168
+ if (decoration.includes("none")) {
16169
+ props.underline = "none";
16170
+ props.strike = "noStrike";
16171
+ }
16172
+ }
16173
+ const family = css.get("font-family");
16174
+ const typeface2 = family ? cssFirstFontFamily(family) : void 0;
16175
+ if (typeface2) props.latin = { typeface: typeface2 };
16176
+ const size = css.get("font-size");
16177
+ const sizePt = size ? cssFontSizePt(size) : void 0;
16178
+ if (sizePt !== void 0) props.sizePt = sizePt;
16179
+ const color2 = css.get("color");
16180
+ const hex = color2 ? parseCssColorHex(color2) : void 0;
16181
+ if (hex) props.fill = { kind: "solid", color: srgb(hex) };
16182
+ const shorthand = css.get("background");
16183
+ const highlight = css.get("mso-highlight") ?? (inline ? css.get("background-color") ?? (shorthand ? /^(rgba?\([^)]*\)|#\w+|[a-z]+)/i.exec(shorthand.trim())?.[1] : void 0) : void 0);
16184
+ const highlightHex = highlight ? parseCssColorHex(highlight) : void 0;
16185
+ if (highlightHex) props.highlight = srgb(highlightHex);
16186
+ const vertical = css.get("vertical-align");
16187
+ if (vertical === "super") props.baseline = 0.3;
16188
+ else if (vertical === "sub") props.baseline = -0.25;
16189
+ const caps = css.get("font-variant");
16190
+ if (caps === "small-caps") props.caps = "small";
16191
+ if (css.get("text-transform") === "uppercase") props.caps = "all";
16192
+ return props;
16193
+ }
16194
+ var ALIGN = {
16195
+ left: "l",
16196
+ start: "l",
16197
+ center: "ctr",
16198
+ right: "r",
16199
+ end: "r",
16200
+ justify: "just"
16201
+ };
16202
+ function blockAlignment(name2, attrs2) {
16203
+ if (name2 === "center") return "ctr";
16204
+ const css = parseCssDeclarations(attrs2.get("style") ?? "");
16205
+ return ALIGN[(css.get("text-align") ?? attrs2.get("align") ?? "").trim().toLowerCase()];
16206
+ }
16207
+ function msoListLevel(attrs2) {
16208
+ const css = parseCssDeclarations(attrs2.get("style") ?? "");
16209
+ const list2 = css.get("mso-list");
16210
+ if (!list2 || /^\s*ignore\b/i.test(list2)) return void 0;
16211
+ const level4 = /level(\d{1,2})/i.exec(list2)?.[1];
16212
+ return Math.min(8, Math.max(0, (level4 ? Number(level4) : 1) - 1));
16213
+ }
16214
+ var MARKER_CHARS = /* @__PURE__ */ new Set([
16215
+ "\u2022",
16216
+ "\u25AA",
16217
+ "\u25CF",
16218
+ "\u25CB",
16219
+ "\u25A0",
16220
+ "\u2013",
16221
+ "-",
16222
+ "*",
16223
+ "o"
16224
+ ]);
16225
+ function bulletFromMarker(marker) {
16226
+ const text3 = marker.replace(/\s+/g, "");
16227
+ const numbered = /^(\(?)(\d{1,4}|[a-z]|[A-Z]|[ivxlc]{1,6}|[IVXLC]{1,6})([.)])$/.exec(text3);
16228
+ if (numbered) {
16229
+ const body = numbered[2] ?? "";
16230
+ const suffix = numbered[1] ? "ParenBoth" : numbered[3] === ")" ? "ParenR" : "Period";
16231
+ const kind = /^\d+$/.test(body) ? "arabic" : /^[ivxlc]+$/.test(body) && body !== "c" ? "romanLc" : /^[IVXLC]+$/.test(body) && body !== "C" ? "romanUc" : /^[a-z]$/.test(body) ? "alphaLc" : "alphaUc";
16232
+ const startAt = /^\d+$/.test(body) ? Number(body) : void 0;
16233
+ return { kind: "autoNumber", scheme: `${kind}${suffix}`, ...startAt ? { startAt } : {} };
16234
+ }
16235
+ const char = [...text3][0] ?? "";
16236
+ return { kind: "char", char: MARKER_CHARS.has(char) ? char : "\u2022" };
16237
+ }
16238
+ function listBullet(ordered2, attrs2, level4) {
16239
+ if (!ordered2)
16240
+ return { kind: "char", char: ["\u2022", "\u2013", "\u2022"][level4 % 3] ?? "\u2022" };
16241
+ const type = attrs2.get("type") ?? "1";
16242
+ const scheme2 = { a: "alphaLcPeriod", A: "alphaUcPeriod", i: "romanLcPeriod", I: "romanUcPeriod" }[type] ?? "arabicPeriod";
16243
+ const start = Math.trunc(Number(attrs2.get("start")));
16244
+ return {
16245
+ kind: "autoNumber",
16246
+ scheme: scheme2,
16247
+ ...Number.isFinite(start) && start > 1 && start < 32768 ? { startAt: start } : {}
16248
+ };
16249
+ }
16250
+
16251
+ // drawingml/html-text-paste.ts
16252
+ var DEFAULT_HTML_TEXT_PASTE_LIMITS = {
16253
+ maxInputLength: 2e6,
16254
+ maxTokens: 5e4,
16255
+ maxDepth: 64,
16256
+ maxTextLength: 1e5,
16257
+ maxParagraphs: 2e3
16258
+ };
16259
+ var BLOCKS = /* @__PURE__ */ new Set([
16260
+ "p",
16261
+ "div",
16262
+ "h1",
16263
+ "h2",
16264
+ "h3",
16265
+ "h4",
16266
+ "h5",
16267
+ "h6",
16268
+ "li",
16269
+ "ul",
16270
+ "ol",
16271
+ "dl",
16272
+ "dt",
16273
+ "dd",
16274
+ "blockquote",
16275
+ "pre",
16276
+ "address",
16277
+ "article",
16278
+ "aside",
16279
+ "section",
16280
+ "header",
16281
+ "footer",
16282
+ "nav",
16283
+ "main",
16284
+ "figure",
16285
+ "figcaption",
16286
+ "center",
16287
+ "table",
16288
+ "tbody",
16289
+ "thead",
16290
+ "tfoot",
16291
+ "tr",
16292
+ "caption",
16293
+ "body",
16294
+ "html"
16295
+ ]);
16296
+ var VOID = /* @__PURE__ */ new Set([
16297
+ "br",
16298
+ "img",
16299
+ "hr",
16300
+ "meta",
16301
+ "link",
16302
+ "input",
16303
+ "wbr",
16304
+ "col",
16305
+ "area",
16306
+ "base",
16307
+ "source",
16308
+ "embed",
16309
+ "param",
16310
+ "track"
16311
+ ]);
16312
+ var BULLET_INDENT_EMU = 285750;
16313
+ var LEVEL_STEP_EMU = 457200;
16314
+ var sameProps = (a2, b) => JSON.stringify(a2 ?? {}) === JSON.stringify(b ?? {});
16315
+ function htmlToDrawingParagraphs(html, limits = {}) {
16316
+ const bounds2 = { ...DEFAULT_HTML_TEXT_PASTE_LIMITS, ...limits };
16317
+ let truncated = html.length > bounds2.maxInputLength;
16318
+ const source2 = htmlClipboardFragment(truncated ? html.slice(0, bounds2.maxInputLength) : html);
16319
+ const tokens = tokenizeHtml(source2, bounds2.maxTokens);
16320
+ if (tokens.length >= bounds2.maxTokens) truncated = true;
16321
+ const paragraphs = [];
16322
+ const hyperlinks = {};
16323
+ const stack = [{ name: "#root", run: {}, pre: false, marker: false }];
16324
+ let current = null;
16325
+ let textLength = 0;
16326
+ let marker = null;
16327
+ let conditionalMarker = false;
16328
+ let stopped = false;
16329
+ const top = () => stack[stack.length - 1];
16330
+ const paragraphProperties = () => {
16331
+ const props = {};
16332
+ let listDepth = 0;
16333
+ let item2;
16334
+ let list2;
16335
+ let msoLevel;
16336
+ for (let i2 = stack.length - 1; i2 >= 0; i2--) {
16337
+ const frame2 = stack[i2];
16338
+ if (props.align === void 0 && frame2.align) props.align = frame2.align;
16339
+ if (frame2.name === "li" && !item2) item2 = frame2;
16340
+ if (frame2.name === "ul" || frame2.name === "ol") {
16341
+ listDepth++;
16342
+ list2 ??= frame2;
16343
+ }
16344
+ if (msoLevel === void 0 && frame2.msoLevel !== void 0) msoLevel = frame2.msoLevel;
16345
+ }
16346
+ if (item2 && list2) {
16347
+ const level4 = Math.min(8, listDepth - 1);
16348
+ props.bullet = listBullet(list2.ordered ?? false, list2.attrs ?? /* @__PURE__ */ new Map(), level4);
16349
+ if (level4 > 0) props.level = level4;
16350
+ props.marginLeftEmu = BULLET_INDENT_EMU + level4 * LEVEL_STEP_EMU;
16351
+ props.indentEmu = -BULLET_INDENT_EMU;
16352
+ } else if (msoLevel !== void 0) {
16353
+ if (msoLevel > 0) props.level = msoLevel;
16354
+ props.marginLeftEmu = BULLET_INDENT_EMU + msoLevel * LEVEL_STEP_EMU;
16355
+ props.indentEmu = -BULLET_INDENT_EMU;
16356
+ props.bullet = { kind: "char", char: "\u2022" };
16357
+ }
16358
+ return Object.keys(props).length ? props : void 0;
16359
+ };
16360
+ const finish2 = () => {
16361
+ current = null;
16362
+ };
16363
+ const ensure2 = () => {
16364
+ if (current) return current;
16365
+ if (paragraphs.length >= bounds2.maxParagraphs) {
16366
+ truncated = stopped = true;
16367
+ return null;
16368
+ }
16369
+ const properties = paragraphProperties();
16370
+ current = { items: [], ...properties ? { properties } : {} };
16371
+ paragraphs.push(current);
16372
+ return current;
16373
+ };
16374
+ const lastChar = (paragraph2) => {
16375
+ const last = paragraph2.items[paragraph2.items.length - 1];
16376
+ if (!last) return "";
16377
+ return last.kind === "run" ? last.text.slice(-1) : "\n";
16378
+ };
16379
+ const addText = (raw2, verbatim = false) => {
16380
+ const frame2 = top();
16381
+ if (marker !== null || frame2.marker) {
16382
+ if (marker !== null) marker += raw2;
16383
+ return;
16384
+ }
16385
+ let text3 = frame2.pre || verbatim ? raw2.replace(/\r\n?/g, "\n") : raw2.replace(/[ \t\n\r\f]+/g, " ");
16386
+ if (!frame2.pre && !current && text3.trim() === "") return;
16387
+ const paragraph2 = ensure2();
16388
+ if (!paragraph2) return;
16389
+ if (!frame2.pre && text3.startsWith(" ") && /^$|[ \n]/.test(lastChar(paragraph2)))
16390
+ text3 = text3.slice(1);
16391
+ text3 = text3.replace(/\u00a0/g, " ");
16392
+ if (textLength + text3.length > bounds2.maxTextLength) {
16393
+ text3 = text3.slice(0, Math.max(0, bounds2.maxTextLength - textLength));
16394
+ truncated = stopped = true;
16395
+ }
16396
+ textLength += text3.length;
16397
+ const lines2 = text3.split("\n");
16398
+ for (const [index, line4] of lines2.entries()) {
16399
+ if (index > 0) paragraph2.items.push({ kind: "break", properties: { ...frame2.run } });
16400
+ if (!line4) continue;
16401
+ const last = paragraph2.items[paragraph2.items.length - 1];
16402
+ if (last?.kind === "run" && sameProps(last.properties, frame2.run)) last.text += line4;
16403
+ else
16404
+ paragraph2.items.push({
16405
+ kind: "run",
16406
+ text: line4,
16407
+ ...Object.keys(frame2.run).length ? { properties: { ...frame2.run } } : {}
16408
+ });
16409
+ }
16410
+ };
16411
+ const close = (name2) => {
16412
+ for (let i2 = stack.length - 1; i2 > 0; i2--) {
16413
+ if (stack[i2].name !== name2) continue;
16414
+ while (stack.length > i2) {
16415
+ const frame2 = stack.pop();
16416
+ if (BLOCKS.has(frame2.name)) finish2();
16417
+ }
16418
+ return true;
16419
+ }
16420
+ return false;
16421
+ };
16422
+ for (const token2 of tokens) {
16423
+ if (stopped) break;
16424
+ if (token2.kind === "text") {
16425
+ if (token2.text) addText(token2.text);
16426
+ continue;
16427
+ }
16428
+ if (token2.kind === "conditional") {
16429
+ if (token2.open && token2.supportLists) {
16430
+ conditionalMarker = true;
16431
+ marker = "";
16432
+ } else if (!token2.open && conditionalMarker) {
16433
+ conditionalMarker = false;
16434
+ const typed = marker ?? "";
16435
+ marker = null;
16436
+ applyMarker(typed);
16437
+ }
16438
+ continue;
16439
+ }
16440
+ if (token2.kind === "close") {
16441
+ const frame3 = top();
16442
+ if (frame3.marker && frame3.name === token2.name) {
16443
+ stack.pop();
16444
+ const typed = marker ?? "";
16445
+ marker = null;
16446
+ applyMarker(typed);
16447
+ continue;
16448
+ }
16449
+ close(token2.name);
16450
+ continue;
16451
+ }
16452
+ const { name: name2, attrs: attrs2 } = token2;
16453
+ if (name2 === "br") {
16454
+ const paragraph2 = ensure2();
16455
+ paragraph2?.items.push({ kind: "break", properties: { ...top().run } });
16456
+ continue;
16457
+ }
16458
+ if (name2 === "hr") {
16459
+ finish2();
16460
+ continue;
16461
+ }
16462
+ if ((name2 === "td" || name2 === "th") && current) {
16463
+ addText(" ", true);
16464
+ }
16465
+ if (VOID.has(name2) || token2.selfClosing) continue;
16466
+ if (name2 === "p" || name2 === "li" || /^h[1-6]$/.test(name2) || name2 === "div") {
16467
+ if (top().name === "p") close("p");
16468
+ }
16469
+ if (name2 === "li") {
16470
+ for (let i2 = stack.length - 1; i2 > 0; i2--) {
16471
+ const open = stack[i2].name;
16472
+ if (open === "ul" || open === "ol") break;
16473
+ if (open === "li") {
16474
+ close("li");
16475
+ break;
16476
+ }
16477
+ }
16478
+ }
16479
+ if (BLOCKS.has(name2)) finish2();
16480
+ if (stack.length > bounds2.maxDepth) {
16481
+ truncated = true;
16482
+ continue;
16483
+ }
16484
+ const parent = top();
16485
+ const block = BLOCKS.has(name2);
16486
+ const run2 = {
16487
+ ...parent.run,
16488
+ ...tagRunProperties(name2, attrs2),
16489
+ ...cssRunProperties(attrs2.get("style") ?? "", !block)
16490
+ };
16491
+ const href = name2 === "a" ? attrs2.get("href")?.trim() : void 0;
16492
+ if (href && !href.startsWith("#") && hyperlinkPolicy(href).store) {
16493
+ const relId = `htmlLink${Object.keys(hyperlinks).length + 1}`;
16494
+ hyperlinks[relId] = href;
16495
+ const tooltip = attrs2.get("title")?.slice(0, 256);
16496
+ run2.hyperlinkClick = { relId, ...tooltip ? { tooltip } : {} };
16497
+ }
16498
+ const isMarker = /mso-list\s*:\s*ignore/i.test(attrs2.get("style") ?? "");
16499
+ const frame2 = {
16500
+ name: name2,
16501
+ run: run2,
16502
+ pre: parent.pre || name2 === "pre",
16503
+ marker: isMarker
16504
+ };
16505
+ if (block) {
16506
+ const align = blockAlignment(name2, attrs2);
16507
+ if (align) frame2.align = align;
16508
+ const level4 = name2 === "p" || name2 === "div" ? msoListLevel(attrs2) : void 0;
16509
+ if (level4 !== void 0) frame2.msoLevel = level4;
16510
+ }
16511
+ if (name2 === "ul" || name2 === "ol") {
16512
+ frame2.ordered = name2 === "ol";
16513
+ frame2.attrs = attrs2;
16514
+ }
16515
+ stack.push(frame2);
16516
+ if (isMarker && marker === null) marker = "";
16517
+ }
16518
+ function applyMarker(typed) {
16519
+ const paragraph2 = ensure2();
16520
+ if (!paragraph2 || !typed.trim()) return;
16521
+ paragraph2.properties = { ...paragraph2.properties, bullet: bulletFromMarker(typed) };
16522
+ }
16523
+ for (const paragraph2 of paragraphs) {
16524
+ const last = paragraph2.items[paragraph2.items.length - 1];
16525
+ if (last?.kind === "run") {
16526
+ last.text = last.text.replace(/ +$/, "");
16527
+ if (!last.text) paragraph2.items.pop();
16528
+ }
16529
+ }
16530
+ const empty = (p2) => p2 !== void 0 && p2.items.length === 0 && !p2.properties?.bullet;
16531
+ while (empty(paragraphs[paragraphs.length - 1])) paragraphs.pop();
16532
+ while (empty(paragraphs[0])) paragraphs.shift();
16533
+ return { paragraphs, hyperlinks, truncated };
16534
+ }
16535
+ function drawingParagraphsText(paragraphs) {
16536
+ return paragraphs.map(
16537
+ (p2) => p2.items.map((item2) => item2.kind === "break" ? "\n" : "text" in item2 ? item2.text : "").join("")
16538
+ ).join("\n");
16539
+ }
16540
+
15768
16541
  // chart/region-map/value-color-positions.ts
15769
16542
  function schemaPosition(node, end) {
15770
16543
  for (const kind of ["number", "percent"]) {
@@ -15993,10 +16766,10 @@ function liveLevels(ref, evaluateRef) {
15993
16766
  return levels;
15994
16767
  }
15995
16768
  function hierarchyView(chart, model, evaluateRef) {
15996
- const first2 = model.series[0];
16769
+ const first3 = model.series[0];
15997
16770
  const live = liveLevels(chart.series[0]?.categoriesRef, evaluateRef);
15998
16771
  if (live?.[0]) model.categories = live[0];
15999
- const count = Math.max(first2?.values.length ?? 0, model.categories.length);
16772
+ const count = Math.max(first3?.values.length ?? 0, model.categories.length);
16000
16773
  const supplied = live ?? chart.hierarchy?.levels ?? [];
16001
16774
  const levels = supplied.length > 1 ? normalizeLevels(supplied, count) : [];
16002
16775
  model.hierarchy = {
@@ -16226,16 +16999,16 @@ function waterfallView(chart, model, ctx) {
16226
16999
  model.categories = steps.map((_, i2) => labels2[i2] ?? String(i2 + 1));
16227
17000
  }
16228
17001
  function histogramView(chart, model) {
16229
- const first2 = model.series[0];
16230
- if (!first2) return;
16231
- const raw2 = first2.values.map((v) => v ?? Number.NaN);
17002
+ const first3 = model.series[0];
17003
+ if (!first3) return;
17004
+ const raw2 = first3.values.map((v) => v ?? Number.NaN);
16232
17005
  const options2 = chart.histogram ?? {};
16233
17006
  const bins = options2.aggregateByCategory ? aggregateByCategory(
16234
- first2.values.map((v) => v ?? 0),
17007
+ first3.values.map((v) => v ?? 0),
16235
17008
  model.categories
16236
17009
  ) : computeHistogramBins(raw2, options2, formatAxisValue);
16237
17010
  model.categories = bins.map((bin) => bin.label);
16238
- first2.values = bins.map((bin) => bin.value);
17011
+ first3.values = bins.map((bin) => bin.value);
16239
17012
  model.barGapWidth = 0;
16240
17013
  model.barOverlap = 0;
16241
17014
  }
@@ -17269,12 +18042,12 @@ function resolveValueColorStops(valueColors, valueColorPositions, minVal, maxVal
17269
18042
  function buildValueColorScale(stops) {
17270
18043
  const sorted = [...stops].sort((a2, b) => a2.position - b.position);
17271
18044
  return (t) => {
17272
- const clamped = Math.max(0, Math.min(1, t)), first2 = sorted[0];
17273
- if (!first2) {
18045
+ const clamped = Math.max(0, Math.min(1, t)), first3 = sorted[0];
18046
+ if (!first3) {
17274
18047
  return "#94a3b8";
17275
18048
  }
17276
18049
  if (sorted.length === 1) {
17277
- return first2.color;
18050
+ return first3.color;
17278
18051
  }
17279
18052
  for (let i2 = 0; i2 < sorted.length - 1; i2++) {
17280
18053
  const a2 = sorted[i2], b = sorted[i2 + 1];
@@ -17286,8 +18059,8 @@ function buildValueColorScale(stops) {
17286
18059
  );
17287
18060
  }
17288
18061
  }
17289
- const last = sorted[sorted.length - 1] ?? first2;
17290
- return clamped <= first2.position ? first2.color : last.color;
18062
+ const last = sorted[sorted.length - 1] ?? first3;
18063
+ return clamped <= first3.position ? first3.color : last.color;
17291
18064
  };
17292
18065
  }
17293
18066
 
@@ -18320,15 +19093,15 @@ function sliceLabels(model, marks, out) {
18320
19093
  outside: Math.hypot(x - mark.cx, y - mark.cy) > mark.outer
18321
19094
  });
18322
19095
  }
18323
- const first2 = marks[0];
18324
- if (!first2) return;
19096
+ const first3 = marks[0];
19097
+ if (!first3) return;
18325
19098
  const nudges = nudgeOutsideLabels(
18326
19099
  items.flatMap(
18327
19100
  (item2, id) => item2.outside && !item2.label.layout ? [{ id, x: item2.x, y: item2.y, w: item2.m.w, h: item2.m.h }] : []
18328
19101
  ),
18329
- { cx: first2.cx, cy: first2.cy, r: first2.outer },
18330
- first2.cy - first2.outer,
18331
- first2.cy + first2.outer
19102
+ { cx: first3.cx, cy: first3.cy, r: first3.outer },
19103
+ first3.cy - first3.outer,
19104
+ first3.cy + first3.outer
18332
19105
  );
18333
19106
  for (const [id, item2] of items.entries()) {
18334
19107
  const { mark, label, m } = item2;
@@ -18476,9 +19249,9 @@ function radarSvg(model, area) {
18476
19249
 
18477
19250
  // chart/render/chart-svg-hierarchy.ts
18478
19251
  var colorAt = (model, index) => {
18479
- const first2 = model.series[0];
18480
- const colors = first2?.pointColors;
18481
- return (colors && colors.length > 0 ? colors[index % colors.length] : void 0) ?? first2?.color ?? "#4472C4";
19252
+ const first3 = model.series[0];
19253
+ const colors = first3?.pointColors;
19254
+ return (colors && colors.length > 0 ? colors[index % colors.length] : void 0) ?? first3?.color ?? "#4472C4";
18482
19255
  };
18483
19256
  var leafValues = (model) => (model.series[0]?.values ?? []).map((v) => v ?? 0);
18484
19257
  function treemapSvg(model, area) {
@@ -18638,17 +19411,17 @@ function chartLegendSvg(model, area, frame2, options2) {
18638
19411
  }
18639
19412
  function legendEntries(model) {
18640
19413
  if (model.type === "pie" || model.type === "doughnut") {
18641
- const first2 = model.series[0];
19414
+ const first3 = model.series[0];
18642
19415
  return model.categories.map((label, i2) => ({
18643
19416
  label,
18644
- color: first2?.pointColors?.[i2] ?? first2?.color ?? "#4472C4"
19417
+ color: first3?.pointColors?.[i2] ?? first3?.color ?? "#4472C4"
18645
19418
  }));
18646
19419
  }
18647
19420
  if ((model.type === "treemap" || model.type === "sunburst") && model.hierarchy) {
18648
- const first2 = model.series[0];
19421
+ const first3 = model.series[0];
18649
19422
  return model.hierarchy.branches.map((label, i2) => ({
18650
19423
  label,
18651
- color: first2?.pointColors?.[i2 % Math.max(1, first2.pointColors.length)] ?? first2?.color ?? "#4472C4"
19424
+ color: first3?.pointColors?.[i2 % Math.max(1, first3.pointColors.length)] ?? first3?.color ?? "#4472C4"
18652
19425
  }));
18653
19426
  }
18654
19427
  if (model.type === "waterfall" && model.waterfall)
@@ -20652,10 +21425,10 @@ function setChartTypedCategories(space3, values) {
20652
21425
  ...source2.levels.map((level4) => chartCacheValues(level4).length)
20653
21426
  ) !== values.length)
20654
21427
  throw new RangeError("Growing a hierarchy requires every category level.");
20655
- const first2 = source2.levels[0];
20656
- if (!first2) throw new RangeError("The category hierarchy has no levels.");
20657
- first2.pointCount = values.length;
20658
- first2.points = values.flatMap((value, index) => value === "" ? [] : [{ index, value }]);
21428
+ const first3 = source2.levels[0];
21429
+ if (!first3) throw new RangeError("The category hierarchy has no levels.");
21430
+ first3.pointCount = values.length;
21431
+ first3.points = values.flatMap((value, index) => value === "" ? [] : [{ index, value }]);
20659
21432
  } else if (source2?.cache?.type === "number" || key === "xValues") {
20660
21433
  const numbers = values.map((value) => value.trim() === "" ? null : Number(value));
20661
21434
  series2[key] = key === "xValues" || numbers.every((value) => value === null || Number.isFinite(value)) ? numberSource(numbers, source2, source2?.formula) : categorySource(values, source2);
@@ -20799,7 +21572,7 @@ function defaultChartAxes(horizontal, scatter2, ids = DEFAULT_CHART_AXIS_IDS) {
20799
21572
  tickLabelPosition: "nextTo",
20800
21573
  crosses: "autoZero"
20801
21574
  });
20802
- const first2 = scatter2 ? {
21575
+ const first3 = scatter2 ? {
20803
21576
  ...common(),
20804
21577
  kind: "val",
20805
21578
  id: firstId,
@@ -20828,7 +21601,7 @@ function defaultChartAxes(horizontal, scatter2, ids = DEFAULT_CHART_AXIS_IDS) {
20828
21601
  crossAxisId: firstId,
20829
21602
  crossBetween: scatter2 ? "midCat" : "between"
20830
21603
  };
20831
- return [first2, second];
21604
+ return [first3, second];
20832
21605
  }
20833
21606
  var CATEGORY_ONLY = [
20834
21607
  "auto",
@@ -21061,7 +21834,7 @@ function applyChartColorPalette(space3, from, to) {
21061
21834
  });
21062
21835
  });
21063
21836
  }
21064
- var srgb = (hex) => ({
21837
+ var srgb2 = (hex) => ({
21065
21838
  kind: "srgb",
21066
21839
  value: hex.replace("#", "").toUpperCase(),
21067
21840
  transforms: []
@@ -21086,14 +21859,14 @@ function applyChartStylePreset(space3, id) {
21086
21859
  const points2 = new Map(series2.dataPoints.map((point) => [point.index ?? 0, point]));
21087
21860
  for (let at2 = 0; at2 < count; at2++) {
21088
21861
  const point = points2.get(at2) ?? { index: at2 };
21089
- point.spPr = paintShape(point.spPr, srgb(colors[at2 % colors.length]), false);
21862
+ point.spPr = paintShape(point.spPr, srgb2(colors[at2 % colors.length]), false);
21090
21863
  points2.set(at2, point);
21091
21864
  }
21092
21865
  series2.dataPoints = [...points2.values()].sort((a2, b) => (a2.index ?? 0) - (b.index ?? 0));
21093
21866
  return;
21094
21867
  }
21095
21868
  const line4 = LINE_KINDS.has(group2.kind);
21096
- series2.spPr = paintShape(series2.spPr, srgb(colors[index % colors.length]), line4);
21869
+ series2.spPr = paintShape(series2.spPr, srgb2(colors[index % colors.length]), line4);
21097
21870
  if (series2.marker?.spPr) delete series2.marker.spPr.fill;
21098
21871
  for (const point of series2.dataPoints) {
21099
21872
  if (point.spPr) delete point.spPr.fill;
@@ -21612,14 +22385,14 @@ function axisPair(space3, group2) {
21612
22385
  }
21613
22386
  function chartSeriesSecondaryAxisSupported(space3, seriesIndex) {
21614
22387
  const { group: group2 } = chartSeriesEntryAt(space3, seriesIndex);
21615
- const first2 = space3.plotArea.groups[0];
21616
- if (!first2 || seriesIndex === 0 || group2.is3D || first2.is3D) return false;
21617
- if (![group2.kind, first2.kind].every((kind) => ["bar", "line", "area"].includes(kind)))
22388
+ const first3 = space3.plotArea.groups[0];
22389
+ if (!first3 || seriesIndex === 0 || group2.is3D || first3.is3D) return false;
22390
+ if (![group2.kind, first3.kind].every((kind) => ["bar", "line", "area"].includes(kind)))
21618
22391
  return false;
21619
- if (group2.barDirection === "bar" || first2.barDirection === "bar") return false;
22392
+ if (group2.barDirection === "bar" || first3.barDirection === "bar") return false;
21620
22393
  if (group2.series.length > 1 && (group2.grouping === "stacked" || group2.grouping === "percentStacked" || !!group2.extLst))
21621
22394
  return false;
21622
- return !!axisPair(space3, group2) && !!axisPair(space3, first2);
22395
+ return !!axisPair(space3, group2) && !!axisPair(space3, first3);
21623
22396
  }
21624
22397
  function chartSeriesOnSecondaryAxis(space3, seriesIndex) {
21625
22398
  const { group: group2 } = chartSeriesEntryAt(space3, seriesIndex);
@@ -21737,14 +22510,14 @@ function applyChartEditIntent(space3, intent) {
21737
22510
  function chartSpaceDataSheet(space3) {
21738
22511
  const entries = chartSeriesEntries(space3);
21739
22512
  const firstEntry = entries[0];
21740
- const first2 = firstEntry ? isXYChartKind(firstEntry.group.kind) ? firstEntry.series.xValues : firstEntry.series.categories : void 0;
22513
+ const first3 = firstEntry ? isXYChartKind(firstEntry.group.kind) ? firstEntry.series.xValues : firstEntry.series.categories : void 0;
21741
22514
  const valuesOf = (index) => {
21742
22515
  const entry3 = entries[index];
21743
22516
  const source2 = isXYChartKind(entry3.group.kind) ? entry3.series.yValues : entry3.series.values;
21744
22517
  return chartSourceValues(source2).map((value) => typeof value === "number" ? value : null);
21745
22518
  };
21746
22519
  const longest = entries.reduce((max, _, index) => Math.max(max, valuesOf(index).length), 0);
21747
- const labels2 = chartSourceValues(first2).map(String);
22520
+ const labels2 = chartSourceValues(first3).map(String);
21748
22521
  const count = Math.max(labels2.length, longest);
21749
22522
  const categories = Array.from({ length: count }, (_, index) => labels2[index] ?? "");
21750
22523
  return {
@@ -21850,11 +22623,11 @@ function axis(kind, id, crossAxisId, position) {
21850
22623
  }
21851
22624
  function minimalChartAxes(group2, ids) {
21852
22625
  if (!groupHasAxes(group2.element)) return [];
21853
- const [first2, second, third] = ids;
22626
+ const [first3, second, third] = ids;
21854
22627
  const horizontal = group2.kind === "bar" && group2.barDirection === "bar";
21855
22628
  const axes = [
21856
- axis(isXYChartKind(group2.kind) ? "val" : "cat", first2, second, horizontal ? "l" : "b"),
21857
- axis("val", second, first2, horizontal ? "b" : "l")
22629
+ axis(isXYChartKind(group2.kind) ? "val" : "cat", first3, second, horizontal ? "l" : "b"),
22630
+ axis("val", second, first3, horizontal ? "b" : "l")
21858
22631
  ];
21859
22632
  if (group2.element === "line3DChart" || group2.kind === "surface")
21860
22633
  axes.push(axis("ser", third, second, "b"));
@@ -21915,17 +22688,17 @@ function series(sheet, index, options2, sheetName) {
21915
22688
  }
21916
22689
  function axisIds(options2) {
21917
22690
  const ids = options2.axisIds ?? [];
21918
- const [first2, second, third] = [
22691
+ const [first3, second, third] = [
21919
22692
  ids[0] ?? DEFAULT_CHART_AXIS_IDS[0],
21920
22693
  ids[1] ?? DEFAULT_CHART_AXIS_IDS[1],
21921
22694
  ids[2] ?? DEFAULT_CHART_AXIS_IDS[1] + 1
21922
22695
  ];
21923
- for (const id of [first2, second, third])
22696
+ for (const id of [first3, second, third])
21924
22697
  if (!Number.isSafeInteger(id) || id < 0)
21925
22698
  throw new RangeError("Chart axis ids must be non-negative whole numbers");
21926
- if ((/* @__PURE__ */ new Set([first2, second, third])).size !== 3)
22699
+ if ((/* @__PURE__ */ new Set([first3, second, third])).size !== 3)
21927
22700
  throw new RangeError("Chart axis ids must differ");
21928
- return [first2, second, third];
22701
+ return [first3, second, third];
21929
22702
  }
21930
22703
  function withAxisIds(space3, ids) {
21931
22704
  return editChartSpace(space3, (draft) => {
@@ -22826,9 +23599,9 @@ function setChartSeriesAxis(space3, seriesIndex, valueAxisId2) {
22826
23599
 
22827
23600
  // chart/edit/series-type.ts
22828
23601
  function sameGroupSettings(a2, b) {
22829
- const { series: _a, ...first2 } = a2;
23602
+ const { series: _a, ...first3 } = a2;
22830
23603
  const { series: _b, ...second } = b;
22831
- return JSON.stringify(first2) === JSON.stringify(second);
23604
+ return JSON.stringify(first3) === JSON.stringify(second);
22832
23605
  }
22833
23606
  function joinChartGroups(space3) {
22834
23607
  return editChartSpace(space3, (draft) => {
@@ -22869,11 +23642,11 @@ function setChartSeriesType(space3, index, target) {
22869
23642
  draft.plotArea.groups.splice(groupIndex, 1, ...fragments);
22870
23643
  const groups = draft.plotArea.groups;
22871
23644
  const placed2 = groupIndex + (at2 > 0 ? 1 : 0);
22872
- const join = (first2) => {
22873
- const [a2, b] = [groups[first2], groups[first2 + 1]];
23645
+ const join = (first3) => {
23646
+ const [a2, b] = [groups[first3], groups[first3 + 1]];
22874
23647
  if (!a2 || !b || !sameGroupSettings(a2, b)) return;
22875
23648
  a2.series.push(...b.series);
22876
- groups.splice(first2 + 1, 1);
23649
+ groups.splice(first3 + 1, 1);
22877
23650
  };
22878
23651
  join(placed2);
22879
23652
  if (placed2 > 0) join(placed2 - 1);
@@ -23122,9 +23895,9 @@ function sharesCategories(space3) {
23122
23895
  const entries = chartSeriesEntries(space3);
23123
23896
  if (entries.some(({ group: group2 }) => isXYChartKind(group2.kind))) return false;
23124
23897
  if (entries.some(({ series: series2 }) => series2.categories?.levels || !series2.values)) return false;
23125
- const first2 = JSON.stringify(chartSourceValues(entries[0]?.series.categories));
23898
+ const first3 = JSON.stringify(chartSourceValues(entries[0]?.series.categories));
23126
23899
  return entries.every(
23127
- ({ series: series2 }) => JSON.stringify(chartSourceValues(series2.categories)) === first2
23900
+ ({ series: series2 }) => JSON.stringify(chartSourceValues(series2.categories)) === first3
23128
23901
  );
23129
23902
  }
23130
23903
  function standardLayout(space3, sheetName) {
@@ -23339,11 +24112,13 @@ function relativeFolder(from, to) {
23339
24112
  // text/index.ts
23340
24113
  var text_exports = {};
23341
24114
  __export(text_exports, {
24115
+ AUTO_SPACE_EM: () => AUTO_SPACE_EM,
23342
24116
  FONT_SUBSTITUTION_MAP: () => FONT_SUBSTITUTION_MAP,
23343
24117
  GOOGLE_FONTS_CATALOGUE_DATE: () => GOOGLE_FONTS_CATALOGUE_DATE,
23344
24118
  GOOGLE_FONTS_CSS2_BASE: () => GOOGLE_FONTS_CSS2_BASE,
23345
24119
  GOOGLE_FONTS_FAMILIES: () => GOOGLE_FONTS_FAMILIES,
23346
24120
  GOOGLE_WEBFONT_AXIS: () => GOOGLE_WEBFONT_AXIS,
24121
+ MAX_GLYPHLESS_GLYPHS: () => MAX_GLYPHLESS_GLYPHS,
23347
24122
  METRIC_FONT_SUBSTITUTES: () => METRIC_FONT_SUBSTITUTES,
23348
24123
  OOXML_DATETIME_PATTERNS: () => OOXML_DATETIME_PATTERNS,
23349
24124
  PANOSE_FAMILY_MAP: () => PANOSE_FAMILY_MAP,
@@ -23360,11 +24135,15 @@ __export(text_exports, {
23360
24135
  classifyPanose: () => classifyPanose,
23361
24136
  collectRunFamilies: () => collectRunFamilies,
23362
24137
  collectWebfontFaces: () => collectWebfontFaces,
24138
+ complexBreakAllowed: () => complexBreakAllowed,
23363
24139
  decimalAnchorIndex: () => decimalAnchorIndex,
23364
24140
  decimalSeparatorForLanguage: () => decimalSeparatorForLanguage,
24141
+ decodeHtmlEntities: () => decodeHtmlEntities,
23365
24142
  designTextWidthEm: () => designTextWidthEm,
23366
24143
  detectFontScript: () => detectFontScript,
23367
24144
  distributeRunsText: () => distributeRunsText,
24145
+ eastAsianAutoSpace: () => eastAsianAutoSpace,
24146
+ embeddingPermission: () => embeddingPermission,
23368
24147
  findGoogleFontsFamily: () => findGoogleFontsFamily,
23369
24148
  findLookAlikeGoogleFontsFamily: () => findLookAlikeGoogleFontsFamily,
23370
24149
  findMetricCompatibleGoogleFontsFamily: () => findMetricCompatibleGoogleFontsFamily,
@@ -23379,22 +24158,39 @@ __export(text_exports, {
23379
24158
  getPanoseWeight: () => getPanoseWeight,
23380
24159
  getSubstituteFontFamily: () => getSubstituteFontFamily,
23381
24160
  getSubstituteFonts: () => getSubstituteFonts,
24161
+ glyphlessTrueType: () => glyphlessTrueType,
24162
+ hangsAtLineEnd: () => hangsAtLineEnd,
23382
24163
  hasDesignAdvances: () => hasDesignAdvances,
23383
24164
  hasDirectSubstitution: () => hasDirectSubstitution,
23384
24165
  hasDistinctScriptFonts: () => hasDistinctScriptFonts,
24166
+ htmlClipboardFragment: () => htmlClipboardFragment,
24167
+ isComplexBreakChar: () => isComplexBreakChar,
24168
+ isEastAsianChar: () => isEastAsianChar,
24169
+ isEastAsianLetter: () => isEastAsianLetter,
24170
+ kinsokuLanguage: () => kinsokuLanguage,
24171
+ kinsokuSets: () => kinsokuSets,
23385
24172
  matchGoogleWebfontFragments: () => matchGoogleWebfontFragments,
24173
+ mayDisplayEmbeddedFont: () => mayDisplayEmbeddedFont,
24174
+ mayEmbedFontInEditableDocument: () => mayEmbedFontInEditableDocument,
24175
+ mayEmbedFontSubset: () => mayEmbedFontSubset,
23386
24176
  mergeTextThreeWay: () => mergeTextThreeWay,
23387
24177
  metricFontFamily: () => metricFontFamily,
23388
24178
  namedFontVerticalMetrics: () => namedFontVerticalMetrics,
23389
24179
  normalizeGoogleFontsBaseUrl: () => normalizeGoogleFontsBaseUrl,
23390
24180
  officeFontVerticalMetrics: () => officeFontVerticalMetrics,
23391
24181
  ooxmlDateTimeFieldPicture: () => ooxmlDateTimeFieldPicture,
24182
+ parseCssColorHex: () => parseCssColorHex,
24183
+ parseCssDeclarations: () => parseCssDeclarations,
23392
24184
  parseFontWeightName: () => parseFontWeightName,
24185
+ parseHtmlAttributes: () => parseHtmlAttributes,
23393
24186
  parseLocaleNumber: () => parseLocaleNumber,
23394
24187
  parsePanoseBytes: () => parsePanoseBytes,
23395
24188
  parsePanoseString: () => parsePanoseString,
23396
24189
  parseTrueType: () => parseTrueType,
23397
24190
  parseTsv: () => parseTsv,
24191
+ prohibitedAtLineEnd: () => prohibitedAtLineEnd,
24192
+ prohibitedAtLineStart: () => prohibitedAtLineStart,
24193
+ readSfntFsType: () => readSfntFsType,
23398
24194
  realignOrCollapseRuns: () => realignOrCollapseRuns,
23399
24195
  resolveFontForScript: () => resolveFontForScript,
23400
24196
  resolveFontItalic: () => resolveFontItalic,
@@ -23409,60 +24205,61 @@ __export(text_exports, {
23409
24205
  stripFontStyleSuffix: () => stripFontStyleSuffix,
23410
24206
  subsetTrueType: () => subsetTrueType,
23411
24207
  toTsv: () => toTsv,
24208
+ tokenizeHtml: () => tokenizeHtml,
23412
24209
  wrapStyledRuns: () => wrapStyledRuns
23413
24210
  });
23414
24211
 
23415
24212
  // text/unicode-script-detection.ts
23416
- function detectFontScript(codePoint) {
23417
- if (codePoint >= 11904 && codePoint <= 40959 || // CJK radicals, unified ideographs
23418
- codePoint >= 44032 && codePoint <= 55215 || // Hangul syllables
23419
- codePoint >= 63744 && codePoint <= 64255 || // CJK compatibility ideographs
23420
- codePoint >= 65072 && codePoint <= 65103 || // CJK compatibility forms
23421
- codePoint >= 131072 && codePoint <= 195103 || // CJK extension B-F
23422
- codePoint >= 12288 && codePoint <= 12351 || // CJK symbols & punctuation
23423
- codePoint >= 12352 && codePoint <= 12447 || // Hiragana
23424
- codePoint >= 12448 && codePoint <= 12543 || // Katakana
23425
- codePoint >= 12784 && codePoint <= 12799 || // Katakana extensions
23426
- codePoint >= 65280 && codePoint <= 65519) {
24213
+ function detectFontScript(codePoint2) {
24214
+ if (codePoint2 >= 11904 && codePoint2 <= 40959 || // CJK radicals, unified ideographs
24215
+ codePoint2 >= 44032 && codePoint2 <= 55215 || // Hangul syllables
24216
+ codePoint2 >= 63744 && codePoint2 <= 64255 || // CJK compatibility ideographs
24217
+ codePoint2 >= 65072 && codePoint2 <= 65103 || // CJK compatibility forms
24218
+ codePoint2 >= 131072 && codePoint2 <= 195103 || // CJK extension B-F
24219
+ codePoint2 >= 12288 && codePoint2 <= 12351 || // CJK symbols & punctuation
24220
+ codePoint2 >= 12352 && codePoint2 <= 12447 || // Hiragana
24221
+ codePoint2 >= 12448 && codePoint2 <= 12543 || // Katakana
24222
+ codePoint2 >= 12784 && codePoint2 <= 12799 || // Katakana extensions
24223
+ codePoint2 >= 65280 && codePoint2 <= 65519) {
23427
24224
  return "eastAsia";
23428
24225
  }
23429
- if (codePoint >= 1424 && codePoint <= 1535 || // Hebrew
23430
- codePoint >= 1536 && codePoint <= 1791 || // Arabic
23431
- codePoint >= 1792 && codePoint <= 1871 || // Syriac
23432
- codePoint >= 1872 && codePoint <= 1919 || // Arabic Supplement
23433
- codePoint >= 1920 && codePoint <= 1983 || // Thaana
23434
- codePoint >= 1984 && codePoint <= 2047 || // NKo
23435
- codePoint >= 2048 && codePoint <= 2111 || // Samaritan
23436
- codePoint >= 2304 && codePoint <= 2431 || // Devanagari
23437
- codePoint >= 2432 && codePoint <= 2559 || // Bengali
23438
- codePoint >= 2560 && codePoint <= 2687 || // Gurmukhi
23439
- codePoint >= 2688 && codePoint <= 2815 || // Gujarati
23440
- codePoint >= 2816 && codePoint <= 2943 || // Oriya
23441
- codePoint >= 2944 && codePoint <= 3071 || // Tamil
23442
- codePoint >= 3072 && codePoint <= 3199 || // Telugu
23443
- codePoint >= 3200 && codePoint <= 3327 || // Kannada
23444
- codePoint >= 3328 && codePoint <= 3455 || // Malayalam
23445
- codePoint >= 3456 && codePoint <= 3583 || // Sinhala
23446
- codePoint >= 3584 && codePoint <= 3711 || // Thai
23447
- codePoint >= 3712 && codePoint <= 3839 || // Lao
23448
- codePoint >= 3840 && codePoint <= 4095 || // Tibetan
23449
- codePoint >= 4096 && codePoint <= 4255 || // Myanmar
23450
- codePoint >= 4256 && codePoint <= 4351 || // Georgian
23451
- codePoint >= 6016 && codePoint <= 6143 || // Khmer
23452
- codePoint >= 64336 && codePoint <= 65023 || // Arabic Presentation Forms-A
23453
- codePoint >= 65136 && codePoint <= 65279) {
24226
+ if (codePoint2 >= 1424 && codePoint2 <= 1535 || // Hebrew
24227
+ codePoint2 >= 1536 && codePoint2 <= 1791 || // Arabic
24228
+ codePoint2 >= 1792 && codePoint2 <= 1871 || // Syriac
24229
+ codePoint2 >= 1872 && codePoint2 <= 1919 || // Arabic Supplement
24230
+ codePoint2 >= 1920 && codePoint2 <= 1983 || // Thaana
24231
+ codePoint2 >= 1984 && codePoint2 <= 2047 || // NKo
24232
+ codePoint2 >= 2048 && codePoint2 <= 2111 || // Samaritan
24233
+ codePoint2 >= 2304 && codePoint2 <= 2431 || // Devanagari
24234
+ codePoint2 >= 2432 && codePoint2 <= 2559 || // Bengali
24235
+ codePoint2 >= 2560 && codePoint2 <= 2687 || // Gurmukhi
24236
+ codePoint2 >= 2688 && codePoint2 <= 2815 || // Gujarati
24237
+ codePoint2 >= 2816 && codePoint2 <= 2943 || // Oriya
24238
+ codePoint2 >= 2944 && codePoint2 <= 3071 || // Tamil
24239
+ codePoint2 >= 3072 && codePoint2 <= 3199 || // Telugu
24240
+ codePoint2 >= 3200 && codePoint2 <= 3327 || // Kannada
24241
+ codePoint2 >= 3328 && codePoint2 <= 3455 || // Malayalam
24242
+ codePoint2 >= 3456 && codePoint2 <= 3583 || // Sinhala
24243
+ codePoint2 >= 3584 && codePoint2 <= 3711 || // Thai
24244
+ codePoint2 >= 3712 && codePoint2 <= 3839 || // Lao
24245
+ codePoint2 >= 3840 && codePoint2 <= 4095 || // Tibetan
24246
+ codePoint2 >= 4096 && codePoint2 <= 4255 || // Myanmar
24247
+ codePoint2 >= 4256 && codePoint2 <= 4351 || // Georgian
24248
+ codePoint2 >= 6016 && codePoint2 <= 6143 || // Khmer
24249
+ codePoint2 >= 64336 && codePoint2 <= 65023 || // Arabic Presentation Forms-A
24250
+ codePoint2 >= 65136 && codePoint2 <= 65279) {
23454
24251
  return "complexScript";
23455
24252
  }
23456
- if (codePoint >= 8592 && codePoint <= 8703 || // Arrows
23457
- codePoint >= 8704 && codePoint <= 8959 || // Mathematical operators
23458
- codePoint >= 8960 && codePoint <= 9215 || // Misc technical
23459
- codePoint >= 9472 && codePoint <= 9599 || // Box drawing
23460
- codePoint >= 9600 && codePoint <= 9631 || // Block elements
23461
- codePoint >= 9632 && codePoint <= 9727 || // Geometric shapes
23462
- codePoint >= 9728 && codePoint <= 9983 || // Misc symbols
23463
- codePoint >= 9984 && codePoint <= 10175 || // Dingbats
23464
- codePoint >= 57344 && codePoint <= 63743 || // Private Use Area
23465
- codePoint >= 126976 && codePoint <= 129535) {
24253
+ if (codePoint2 >= 8592 && codePoint2 <= 8703 || // Arrows
24254
+ codePoint2 >= 8704 && codePoint2 <= 8959 || // Mathematical operators
24255
+ codePoint2 >= 8960 && codePoint2 <= 9215 || // Misc technical
24256
+ codePoint2 >= 9472 && codePoint2 <= 9599 || // Box drawing
24257
+ codePoint2 >= 9600 && codePoint2 <= 9631 || // Block elements
24258
+ codePoint2 >= 9632 && codePoint2 <= 9727 || // Geometric shapes
24259
+ codePoint2 >= 9728 && codePoint2 <= 9983 || // Misc symbols
24260
+ codePoint2 >= 9984 && codePoint2 <= 10175 || // Dingbats
24261
+ codePoint2 >= 57344 && codePoint2 <= 63743 || // Private Use Area
24262
+ codePoint2 >= 126976 && codePoint2 <= 129535) {
23466
24263
  return "symbol";
23467
24264
  }
23468
24265
  return "latin";
@@ -23476,14 +24273,14 @@ function segmentByScript(text3) {
23476
24273
  let currentStart = 0;
23477
24274
  let currentText = "";
23478
24275
  for (let i2 = 0; i2 < text3.length; i2++) {
23479
- const codePoint = text3.codePointAt(i2);
23480
- if (codePoint === void 0) {
24276
+ const codePoint2 = text3.codePointAt(i2);
24277
+ if (codePoint2 === void 0) {
23481
24278
  continue;
23482
24279
  }
23483
- const charLength = codePoint > 65535 ? 2 : 1;
24280
+ const charLength = codePoint2 > 65535 ? 2 : 1;
23484
24281
  const char = text3.substring(i2, i2 + charLength);
23485
- const isNeutral = codePoint <= 127 && !/[a-zA-Z0-9]/u.test(char);
23486
- const script = isNeutral ? currentScript ?? "latin" : detectFontScript(codePoint);
24282
+ const isNeutral = codePoint2 <= 127 && !/[a-zA-Z0-9]/u.test(char);
24283
+ const script = isNeutral ? currentScript ?? "latin" : detectFontScript(codePoint2);
23487
24284
  if (script !== currentScript && currentScript !== null) {
23488
24285
  runs.push({
23489
24286
  text: currentText,
@@ -23691,16 +24488,16 @@ function decimalSeparatorForLanguage(language) {
23691
24488
  }
23692
24489
  }
23693
24490
  function decimalAnchorIndex(text3, separator) {
23694
- const first2 = text3.search(/[0-9]/u);
23695
- if (first2 < 0) {
24491
+ const first3 = text3.search(/[0-9]/u);
24492
+ if (first3 < 0) {
23696
24493
  return text3.length;
23697
24494
  }
23698
- let end = first2;
24495
+ let end = first3;
23699
24496
  while (end < text3.length && /[0-9.,]/u.test(text3.charAt(end))) {
23700
24497
  end++;
23701
24498
  }
23702
- const sep = text3.slice(first2, end).indexOf(separator);
23703
- return sep >= 0 ? first2 + sep : end;
24499
+ const sep = text3.slice(first3, end).indexOf(separator);
24500
+ return sep >= 0 ? first3 + sep : end;
23704
24501
  }
23705
24502
 
23706
24503
  // text/change-case.ts
@@ -24213,6 +25010,106 @@ function formatLocaleNumber(value, language) {
24213
25010
  return decimal === "." ? plain : plain.replace(".", decimal);
24214
25011
  }
24215
25012
 
25013
+ // text/east-asian.ts
25014
+ function isEastAsianChar(ch) {
25015
+ const cp = ch.codePointAt(0) ?? 0;
25016
+ return cp >= 4352 && cp <= 4607 || cp >= 11904 && cp <= 40959 || cp >= 43360 && cp <= 43391 || cp >= 44032 && cp <= 55295 || cp >= 63744 && cp <= 64255 || cp >= 65072 && cp <= 65103 || cp >= 65280 && cp <= 65519 || cp >= 131072 && cp <= 262143;
25017
+ }
25018
+ var EAST_ASIAN_LETTER = /^[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u;
25019
+ var LETTER = /^\p{L}/u;
25020
+ var DIGIT = /^\p{Nd}/u;
25021
+ function isEastAsianLetter(grapheme) {
25022
+ return EAST_ASIAN_LETTER.test(grapheme);
25023
+ }
25024
+ function westernKind(grapheme) {
25025
+ if (!grapheme || isEastAsianChar(grapheme)) return void 0;
25026
+ if (DIGIT.test(grapheme)) return "digit";
25027
+ return LETTER.test(grapheme) ? "alpha" : void 0;
25028
+ }
25029
+ function eastAsianAutoSpace(before, after) {
25030
+ if (isEastAsianLetter(before)) return westernKind(after);
25031
+ if (isEastAsianLetter(after)) return westernKind(before);
25032
+ return void 0;
25033
+ }
25034
+ var AUTO_SPACE_EM = 0.25;
25035
+
25036
+ // text/kinsoku.ts
25037
+ var JAPANESE = {
25038
+ noStart: "!%),.:;?]}\xA2\xB0\u2019\u201D\u2030\u2032\u2033\u2103\u3001\u3002\u3005\u3009\u300B\u300D\u300F\u3011\u3015\u309B\u309C\u309D\u309E\u30FB\u30FD\u30FE\uFF01\uFF05\uFF09\uFF0C\uFF0E\uFF1A\uFF1B\uFF1F\uFF3D\uFF5D\uFF61\uFF63\uFF64\uFF65\uFF9E\uFF9F\uFFE0",
25039
+ noEnd: "$([\\{\xA3\xA5\u2018\u201C\u3008\u300A\u300C\u300E\u3010\u3014\uFF04\uFF08\uFF3B\uFF5B\uFF62\uFFE1\uFFE5"
25040
+ };
25041
+ var JAPANESE_STRICT_EXTRA = "\u3041\u3043\u3045\u3047\u3049\u3063\u3083\u3085\u3087\u308E\u30A1\u30A3\u30A5\u30A7\u30A9\u30C3\u30E3\u30E5\u30E7\u30EE\u30F5\u30F6\u30FC\uFF67\uFF68\uFF69\uFF6A\uFF6B\uFF6C\uFF6D\uFF6E\uFF6F\uFF70";
25042
+ var DEFAULTS = {
25043
+ ja: JAPANESE,
25044
+ "zh-Hans": {
25045
+ noStart: "!%),.:;>?]}\xA2\xA8\xB0\xB7\u2015\u2016\u2019\u201D\u2026\u2030\u2032\u2033\u203A\u2103\u3001\u3002\u3003\u3009\u300B\u300D\u300F\u3011\u3015\u3017\u301E\uFE36\uFE3A\uFE3E\uFE40\uFE44\uFE5A\uFE5C\uFE5E\uFF01\uFF02\uFF05\uFF07\uFF09\uFF0C\uFF0E\uFF1A\uFF1B\uFF1F\uFF3D\uFF40\uFF5C\uFF5D\uFF5E\uFFE0",
25046
+ noEnd: "$([{\xA3\xA5\xB7\u2018\u201C\u3008\u300A\u300C\u300E\u3010\u3014\u3016\u301D\uFE59\uFE5B\uFE5D\uFF04\uFF08\uFF0E\uFF3B\uFF5B\uFFE1\uFFE5"
25047
+ },
25048
+ "zh-Hant": {
25049
+ noStart: "!),.:;?]}\xA2\xB7\u2019\u201D\u2022\u2025\u2026\u2027\u2032\u3001\u3002\u3009\u300B\u300D\u300F\u3011\u3015\u301E\uFE30\uFE31\uFE33\uFE34\uFE36\uFE38\uFE3A\uFE3C\uFE3E\uFE40\uFE42\uFE44\uFE4F\uFE50\uFE51\uFE52\uFE54\uFE55\uFE56\uFE57\uFE5A\uFE5C\uFE5E\uFF01\uFF09\uFF0C\uFF0E\uFF1A\uFF1B\uFF1F\uFF3D\uFF5C\uFF5D\uFF64",
25050
+ noEnd: "([{\xA3\xA5\u2018\u201C\u2035\u3008\u300A\u300C\u300E\u3010\u3014\u301D\uFE35\uFE37\uFE39\uFE3B\uFE3D\uFE3F\uFE41\uFE43\uFE59\uFE5B\uFE5D\uFF08\uFF5B"
25051
+ },
25052
+ ko: { noStart: "", noEnd: "" }
25053
+ };
25054
+ function kinsokuLanguage(tag3) {
25055
+ if (!tag3) return void 0;
25056
+ const lower = tag3.toLowerCase();
25057
+ const [primary] = lower.split(/[-_]/);
25058
+ if (primary === "ja") return "ja";
25059
+ if (primary === "ko") return "ko";
25060
+ if (primary !== "zh") return void 0;
25061
+ return /-(hant|tw|hk|mo)(-|$)/.test(lower) ? "zh-Hant" : "zh-Hans";
25062
+ }
25063
+ function kinsokuSets(language, settings = {}) {
25064
+ const base = DEFAULTS[language];
25065
+ const custom = (override) => override && kinsokuLanguage(override.language) === language ? override.chars : void 0;
25066
+ const strictExtra = settings.strict && language === "ja" ? JAPANESE_STRICT_EXTRA : "";
25067
+ return {
25068
+ noStart: custom(settings.noLineBreaksBefore) ?? base.noStart + strictExtra,
25069
+ noEnd: custom(settings.noLineBreaksAfter) ?? base.noEnd
25070
+ };
25071
+ }
25072
+ var first2 = (text3) => String.fromCodePoint(text3.codePointAt(0) ?? 0);
25073
+ function prohibitedAtLineStart(grapheme, sets) {
25074
+ return grapheme.length > 0 && sets.noStart.includes(first2(grapheme));
25075
+ }
25076
+ function prohibitedAtLineEnd(grapheme, sets) {
25077
+ return grapheme.length > 0 && sets.noEnd.includes(first2(grapheme));
25078
+ }
25079
+ var HANGING = {
25080
+ ja: ",.\u2019\u201D\u3001\u3002\u300D\u300F\u3011\uFF09\uFF0C\uFF0E\uFF3D\uFF5D\uFF61\uFF64",
25081
+ "zh-Hans": "!%),.:;>?]}\xA2\xB0\u2019\u201D\u2030\u2032\u2033\u2103\u3001\u3002\u3003\u3009\u300B\u300D\u300F\u3011\u3015\u3017\u301E\uFE5A\uFE5C\uFE5E\uFF01\uFF02\uFF05\uFF07\uFF09\uFF0C\uFF1A\uFF1B\uFF1F\uFF3D\uFF5D\uFFE0",
25082
+ "zh-Hant": "!),.:;?]}\u2019\u201D\u2032\u3001\u3002\u3009\u300B\u300D\u300F\u3011\u3015\u301E\uFE5A\uFE5C\uFE5E\uFF01\uFF09\uFF0C\uFF0E\uFF1A\uFF1B\uFF1F\uFF3D\uFF5D",
25083
+ ko: ""
25084
+ };
25085
+ function hangsAtLineEnd(grapheme, language) {
25086
+ return grapheme.length > 0 && HANGING[language].includes(first2(grapheme));
25087
+ }
25088
+
25089
+ // text/complex-breaks.ts
25090
+ function isComplexBreakChar(ch) {
25091
+ const cp = ch.codePointAt(0) ?? 0;
25092
+ return cp >= 3584 && cp <= 3839 || // Thai, Lao
25093
+ cp >= 4096 && cp <= 4255 || // Myanmar
25094
+ cp >= 6016 && cp <= 6143 || // Khmer
25095
+ cp >= 6624 && cp <= 6655 || // Khmer Symbols
25096
+ cp >= 43488 && cp <= 43519 || // Myanmar Extended-B
25097
+ cp >= 43616 && cp <= 43647;
25098
+ }
25099
+ function isLeadingVowel(cp) {
25100
+ return cp >= 3648 && cp <= 3652 || cp >= 3776 && cp <= 3780;
25101
+ }
25102
+ function isStacker(cp) {
25103
+ return cp === 6098 || cp === 4153;
25104
+ }
25105
+ function complexBreakAllowed(before, after) {
25106
+ if (!before || !after) return false;
25107
+ if (!isComplexBreakChar(before) || !isComplexBreakChar(after)) return false;
25108
+ const last = before.codePointAt(before.length - 1) ?? 0;
25109
+ const lead = before.codePointAt(0) ?? 0;
25110
+ return !(before.length === 1 && isLeadingVowel(lead)) && !isStacker(last);
25111
+ }
25112
+
24216
25113
  // text/font-substitution-map.ts
24217
25114
  var FONT_SUBSTITUTION_MAP = {
24218
25115
  // Microsoft Office default fonts. The Aptos family became the Office
@@ -24661,6 +25558,150 @@ function segmentByFont(text3, fonts) {
24661
25558
  return result;
24662
25559
  }
24663
25560
 
25561
+ // text/truetype/embedding.ts
25562
+ var RESTRICTED = 2;
25563
+ var PREVIEW_PRINT = 4;
25564
+ var EDITABLE = 8;
25565
+ var NO_SUBSETTING = 256;
25566
+ var BITMAP_ONLY = 512;
25567
+ function embeddingPermission(fsType) {
25568
+ const licence = fsType & EDITABLE ? "editable" : fsType & PREVIEW_PRINT ? "preview-print" : fsType & RESTRICTED ? "restricted" : "installable";
25569
+ return {
25570
+ licence,
25571
+ noSubsetting: (fsType & NO_SUBSETTING) !== 0,
25572
+ bitmapOnly: (fsType & BITMAP_ONLY) !== 0
25573
+ };
25574
+ }
25575
+ function mayDisplayEmbeddedFont(permission) {
25576
+ return permission.licence !== "restricted";
25577
+ }
25578
+ function mayEmbedFontInEditableDocument(permission) {
25579
+ return (permission.licence === "installable" || permission.licence === "editable") && !permission.bitmapOnly;
25580
+ }
25581
+ function mayEmbedFontSubset(permission) {
25582
+ return mayDisplayEmbeddedFont(permission) && !permission.noSubsetting && !permission.bitmapOnly;
25583
+ }
25584
+ var SFNT_VERSIONS = /* @__PURE__ */ new Set([65536, 1330926671, 1953658213]);
25585
+ var TTC_TAG = 1953784678;
25586
+ var OS2_TAG = 1330851634;
25587
+ function readSfntFsType(data, header) {
25588
+ const byte = (offset) => header && offset < header.length ? header[offset] : data[offset];
25589
+ const u162 = (offset) => {
25590
+ const hi = byte(offset);
25591
+ const lo = byte(offset + 1);
25592
+ return hi === void 0 || lo === void 0 ? void 0 : hi << 8 | lo;
25593
+ };
25594
+ const u322 = (offset) => {
25595
+ const hi = u162(offset);
25596
+ const lo = u162(offset + 2);
25597
+ return hi === void 0 || lo === void 0 ? void 0 : hi * 65536 + lo;
25598
+ };
25599
+ let base = 0;
25600
+ if (u322(0) === TTC_TAG) {
25601
+ const first3 = u322(12);
25602
+ if (first3 === void 0) return void 0;
25603
+ base = first3;
25604
+ }
25605
+ const version = u322(base);
25606
+ if (version === void 0 || !SFNT_VERSIONS.has(version)) return void 0;
25607
+ const numTables = u162(base + 4) ?? 0;
25608
+ for (let i2 = 0; i2 < numTables; i2++) {
25609
+ const record = base + 12 + i2 * 16;
25610
+ const tag3 = u322(record);
25611
+ if (tag3 === void 0) return void 0;
25612
+ if (tag3 === OS2_TAG) {
25613
+ const offset = u322(record + 8);
25614
+ return offset === void 0 ? void 0 : u162(offset + 8);
25615
+ }
25616
+ }
25617
+ return void 0;
25618
+ }
25619
+
25620
+ // text/truetype/sfnt-write.ts
25621
+ var pad4 = (n3) => n3 + 3 & -4;
25622
+ function checksum(bytes) {
25623
+ let sum = 0;
25624
+ for (let i2 = 0; i2 < bytes.length; i2 += 4)
25625
+ sum = sum + ((bytes[i2] ?? 0) << 24 | (bytes[i2 + 1] ?? 0) << 16 | (bytes[i2 + 2] ?? 0) << 8 | (bytes[i2 + 3] ?? 0)) >>> 0;
25626
+ return sum;
25627
+ }
25628
+ function writeSfnt(tables) {
25629
+ const directory = 12 + tables.length * 16;
25630
+ let total = directory;
25631
+ for (const [, bytes] of tables) total += pad4(bytes.length);
25632
+ const out = new Uint8Array(total);
25633
+ const view = new DataView(out.buffer);
25634
+ view.setUint32(0, 65536);
25635
+ view.setUint16(4, tables.length);
25636
+ const power = 2 ** Math.floor(Math.log2(tables.length));
25637
+ view.setUint16(6, power * 16);
25638
+ view.setUint16(8, Math.log2(power));
25639
+ view.setUint16(10, tables.length * 16 - power * 16);
25640
+ let position = directory;
25641
+ let headAt = -1;
25642
+ tables.forEach(([name2, bytes], index) => {
25643
+ const entry3 = 12 + index * 16;
25644
+ for (let i2 = 0; i2 < 4; i2++) out[entry3 + i2] = name2.charCodeAt(i2);
25645
+ view.setUint32(entry3 + 4, checksum(bytes));
25646
+ view.setUint32(entry3 + 8, position);
25647
+ view.setUint32(entry3 + 12, bytes.length);
25648
+ out.set(bytes, position);
25649
+ if (name2 === "head") headAt = position;
25650
+ position += pad4(bytes.length);
25651
+ });
25652
+ if (headAt >= 0) view.setUint32(headAt + 8, 2981146554 - checksum(out) >>> 0);
25653
+ return out;
25654
+ }
25655
+
25656
+ // text/truetype/glyphless.ts
25657
+ var MAX_GLYPHLESS_GLYPHS = 65535;
25658
+ function glyphlessTrueType(advances2) {
25659
+ const count = Math.min(MAX_GLYPHLESS_GLYPHS, Math.max(1, advances2.length));
25660
+ const advance = (glyph2) => Math.max(0, Math.min(65535, Math.round(advances2[glyph2] ?? 0)));
25661
+ let widest = 0;
25662
+ const hmtx = new Uint8Array(count * 4);
25663
+ const hmtxView = new DataView(hmtx.buffer);
25664
+ for (let glyph2 = 0; glyph2 < count; glyph2++) {
25665
+ hmtxView.setUint16(glyph2 * 4, advance(glyph2));
25666
+ widest = Math.max(widest, advance(glyph2));
25667
+ }
25668
+ const head2 = new Uint8Array(54);
25669
+ const headView = new DataView(head2.buffer);
25670
+ headView.setUint32(0, 65536);
25671
+ headView.setUint32(4, 65536);
25672
+ headView.setUint32(12, 1594834165);
25673
+ headView.setUint16(16, 11);
25674
+ headView.setUint16(18, 1e3);
25675
+ headView.setInt16(38, -200);
25676
+ headView.setInt16(40, 1e3);
25677
+ headView.setInt16(42, 800);
25678
+ headView.setUint16(46, 8);
25679
+ headView.setInt16(48, 2);
25680
+ const hhea = new Uint8Array(36);
25681
+ const hheaView = new DataView(hhea.buffer);
25682
+ hheaView.setUint32(0, 65536);
25683
+ hheaView.setInt16(4, 800);
25684
+ hheaView.setInt16(6, -200);
25685
+ hheaView.setUint16(10, widest);
25686
+ hheaView.setInt16(18, 1);
25687
+ hheaView.setUint16(34, count);
25688
+ const maxp = new Uint8Array(32);
25689
+ const maxpView = new DataView(maxp.buffer);
25690
+ maxpView.setUint32(0, 65536);
25691
+ maxpView.setUint16(4, count);
25692
+ maxpView.setUint16(14, 1);
25693
+ const loca = new Uint8Array((count + 1) * 2);
25694
+ const glyf = new Uint8Array(4);
25695
+ return writeSfnt([
25696
+ ["glyf", glyf],
25697
+ ["head", head2],
25698
+ ["hhea", hhea],
25699
+ ["hmtx", hmtx],
25700
+ ["loca", loca],
25701
+ ["maxp", maxp]
25702
+ ]);
25703
+ }
25704
+
24664
25705
  // text/truetype/parse.ts
24665
25706
  var u16 = (v, o) => o + 2 <= v.byteLength ? v.getUint16(o) : 0;
24666
25707
  var i16 = (v, o) => o + 2 <= v.byteLength ? v.getInt16(o) : 0;
@@ -24790,13 +25831,6 @@ function parseTrueType(data) {
24790
25831
  }
24791
25832
 
24792
25833
  // text/truetype/subset.ts
24793
- var pad4 = (n3) => n3 + 3 & -4;
24794
- function checksum(bytes) {
24795
- let sum = 0;
24796
- for (let i2 = 0; i2 < bytes.length; i2 += 4)
24797
- sum = sum + ((bytes[i2] ?? 0) << 24 | (bytes[i2 + 1] ?? 0) << 16 | (bytes[i2 + 2] ?? 0) << 8 | (bytes[i2 + 3] ?? 0)) >>> 0;
24798
- return sum;
24799
- }
24800
25834
  function components(outline2) {
24801
25835
  if (outline2.length < 10) return [];
24802
25836
  const view = new DataView(outline2.buffer, outline2.byteOffset, outline2.byteLength);
@@ -24829,8 +25863,8 @@ function subsetTrueType(font, used) {
24829
25863
  const source2 = font.outline(glyph2);
24830
25864
  if (!source2.length) return source2;
24831
25865
  const copy = Uint8Array.from(source2);
24832
- const view2 = new DataView(copy.buffer);
24833
- for (const part of components(copy)) view2.setUint16(part.offset, mapped.get(part.glyph) ?? 0);
25866
+ const view = new DataView(copy.buffer);
25867
+ for (const part of components(copy)) view.setUint16(part.offset, mapped.get(part.glyph) ?? 0);
24834
25868
  return copy;
24835
25869
  });
24836
25870
  const count = glyphs.length;
@@ -24873,31 +25907,7 @@ function subsetTrueType(font, used) {
24873
25907
  ["maxp", maxp]
24874
25908
  ])
24875
25909
  if (bytes) tables.push([name2, bytes]);
24876
- const directory = 12 + tables.length * 16;
24877
- let total = directory;
24878
- for (const [, bytes] of tables) total += pad4(bytes.length);
24879
- const out = new Uint8Array(total);
24880
- const view = new DataView(out.buffer);
24881
- view.setUint32(0, 65536);
24882
- view.setUint16(4, tables.length);
24883
- const power = 2 ** Math.floor(Math.log2(tables.length));
24884
- view.setUint16(6, power * 16);
24885
- view.setUint16(8, Math.log2(power));
24886
- view.setUint16(10, tables.length * 16 - power * 16);
24887
- let position = directory;
24888
- let headAt = 0;
24889
- tables.forEach(([name2, bytes], index) => {
24890
- const entry3 = 12 + index * 16;
24891
- for (let i2 = 0; i2 < 4; i2++) out[entry3 + i2] = name2.charCodeAt(i2);
24892
- view.setUint32(entry3 + 4, checksum(bytes));
24893
- view.setUint32(entry3 + 8, position);
24894
- view.setUint32(entry3 + 12, bytes.length);
24895
- out.set(bytes, position);
24896
- if (name2 === "head") headAt = position;
24897
- position += pad4(bytes.length);
24898
- });
24899
- view.setUint32(headAt + 8, 2981146554 - checksum(out) >>> 0);
24900
- return { data: out, glyphs };
25910
+ return { data: writeSfnt(tables), glyphs };
24901
25911
  }
24902
25912
 
24903
25913
  // text/webfonts/google-fonts-catalogue.ts
@@ -27041,9 +28051,9 @@ function impliedStyle(typeface2) {
27041
28051
  return cached;
27042
28052
  }
27043
28053
  function primaryFamily(familyOrList) {
27044
- const first2 = familyOrList.split(",")[0]?.trim() ?? "";
27045
- const quoted = /^(["'])(.*)\1$/u.exec(first2);
27046
- return quoted ? (quoted[2] ?? "").replace(/\\(.)/gu, "$1") : first2;
28054
+ const first3 = familyOrList.split(",")[0]?.trim() ?? "";
28055
+ const quoted = /^(["'])(.*)\1$/u.exec(first3);
28056
+ return quoted ? (quoted[2] ?? "").replace(/\\(.)/gu, "$1") : first3;
27047
28057
  }
27048
28058
  function resolveFontWeight(fontFamily, bold) {
27049
28059
  const implied = fontFamily ? impliedStyle(primaryFamily(fontFamily))?.weight : void 0;
@@ -27767,8 +28777,8 @@ function withHostMenuCommands(entries, commands, context) {
27767
28777
  const middle = entries.map(
27768
28778
  (entry3, index) => index === 0 ? { ...entry3, separatorBefore: top.length > 0 } : entry3
27769
28779
  );
27770
- const first2 = bottom[0];
27771
- if (first2 && top.length + middle.length > 0) first2.separatorBefore = true;
28780
+ const first3 = bottom[0];
28781
+ if (first3 && top.length + middle.length > 0) first3.separatorBefore = true;
27772
28782
  return [...top, ...middle, ...bottom];
27773
28783
  }
27774
28784
  function withoutHiddenEntries(entries, hidden) {
@@ -28471,7 +29481,7 @@ function parseAttributes(source2) {
28471
29481
  }
28472
29482
  return attrs2;
28473
29483
  }
28474
- function tagEnd(xml2, from) {
29484
+ function tagEnd2(xml2, from) {
28475
29485
  let quote = "";
28476
29486
  for (let i2 = from; i2 < xml2.length; i2++) {
28477
29487
  const ch = xml2[i2];
@@ -28502,17 +29512,17 @@ function parseOrderedXml(xml2) {
28502
29512
  i2 = close < 0 ? -1 : xml2.indexOf("<", close + 3);
28503
29513
  continue;
28504
29514
  }
28505
- const end = tagEnd(xml2, i2 + 1);
29515
+ const end = tagEnd2(xml2, i2 + 1);
28506
29516
  if (end < 0) {
28507
29517
  break;
28508
29518
  }
28509
29519
  const next = xml2.indexOf("<", end + 1);
28510
- const first2 = xml2[i2 + 1];
28511
- if (first2 === "?" || first2 === "!") {
29520
+ const first3 = xml2[i2 + 1];
29521
+ if (first3 === "?" || first3 === "!") {
28512
29522
  i2 = next;
28513
29523
  continue;
28514
29524
  }
28515
- const closing = first2 === "/";
29525
+ const closing = first3 === "/";
28516
29526
  let cursor = closing ? i2 + 2 : i2 + 1;
28517
29527
  const nameStart = cursor;
28518
29528
  while (cursor < end && isNameChar2(xml2[cursor])) {
@@ -29340,8 +30350,8 @@ var Glyph = class {
29340
30350
  }
29341
30351
  /** `M p0 L p1 ... Z` through the points. */
29342
30352
  poly(points2, close = true) {
29343
- const [first2, ...rest] = points2;
29344
- return `M ${this.pt(first2)}${rest.map((q) => ` L ${this.pt(q)}`).join("")}${close ? " Z" : ""}`;
30353
+ const [first3, ...rest] = points2;
30354
+ return `M ${this.pt(first3)}${rest.map((q) => ` L ${this.pt(q)}`).join("")}${close ? " Z" : ""}`;
29345
30355
  }
29346
30356
  /** A full circle of radius `r` centred on `(cx, cy)`. */
29347
30357
  circle(cx, cy, r) {
@@ -35898,15 +36908,15 @@ var heart2 = {
35898
36908
  };
35899
36909
  function buildIrregularSeal(name2, points2) {
35900
36910
  const commands = [];
35901
- const first2 = points2[0];
35902
- if (!first2) {
36911
+ const first3 = points2[0];
36912
+ if (!first3) {
35903
36913
  return {
35904
36914
  name: name2,
35905
36915
  rect: FULL_RECT7,
35906
36916
  pathLst: [{ commands: [{ kind: "close" }] }]
35907
36917
  };
35908
36918
  }
35909
- commands.push({ kind: "moveTo", x: String(first2[0]), y: String(first2[1]) });
36919
+ commands.push({ kind: "moveTo", x: String(first3[0]), y: String(first3[1]) });
35910
36920
  for (let i2 = 1; i2 < points2.length; i2++) {
35911
36921
  const p2 = points2[i2];
35912
36922
  commands.push({ kind: "lnTo", x: String(p2[0]), y: String(p2[1]) });
@@ -43615,9 +44625,9 @@ function buildLinks(entries) {
43615
44625
  }
43616
44626
  const firstByName = /* @__PURE__ */ new Map();
43617
44627
  for (const { node } of entries) {
43618
- const first2 = firstByName.get(node.name);
43619
- if (first2) {
43620
- groups.union(first2, node);
44628
+ const first3 = firstByName.get(node.name);
44629
+ if (first3) {
44630
+ groups.union(first3, node);
43621
44631
  } else {
43622
44632
  firstByName.set(node.name, node);
43623
44633
  }
@@ -43800,16 +44810,16 @@ function applyEngineFonts(collected, nodeById, fontName) {
43800
44810
  }
43801
44811
  const fitNode = entry3.textNode ?? entry3.node;
43802
44812
  texts.set(fitNode, text3);
43803
- const first2 = sourceIdsOf(fitNode)[0];
43804
- if (first2 && fitNode.alg.type === "tx" && !txBySource.has(first2)) {
43805
- txBySource.set(first2, fitNode);
44813
+ const first3 = sourceIdsOf(fitNode)[0];
44814
+ if (first3 && fitNode.alg.type === "tx" && !txBySource.has(first3)) {
44815
+ txBySource.set(first3, fitNode);
43806
44816
  }
43807
44817
  }
43808
44818
  const twinOf = /* @__PURE__ */ new Map();
43809
44819
  const entries = [];
43810
44820
  for (const [node, text3] of texts) {
43811
- const first2 = sourceIdsOf(node)[0];
43812
- const twin = first2 && node.alg.type !== "tx" ? txBySource.get(first2) : void 0;
44821
+ const first3 = sourceIdsOf(node)[0];
44822
+ const twin = first3 && node.alg.type !== "tx" ? txBySource.get(first3) : void 0;
43813
44823
  if (twin && texts.has(twin)) {
43814
44824
  twinOf.set(node, twin);
43815
44825
  } else {
@@ -43831,8 +44841,8 @@ function applyEngineFonts(collected, nodeById, fontName) {
43831
44841
  const node = textNode ?? renderedNode;
43832
44842
  const pt2 = sizes.get(node) ?? 18;
43833
44843
  const text3 = texts.get(node);
43834
- const { first: first2, secondary } = text3 ? paragraphSizesPt(text3, pt2) : { first: pt2, secondary: Math.round(pt2 * DESCENDANT_FONT_SCALE) };
43835
- rendered.fontSize = first2 * PX_PER_PT5;
44844
+ const { first: first3, secondary } = text3 ? paragraphSizesPt(text3, pt2) : { first: pt2, secondary: Math.round(pt2 * DESCENDANT_FONT_SCALE) };
44845
+ rendered.fontSize = first3 * PX_PER_PT5;
43836
44846
  rendered.descendantFontSize = hasDescendants(node) ? secondary * PX_PER_PT5 : void 0;
43837
44847
  }
43838
44848
  }
@@ -49033,16 +50043,16 @@ function arrangeByChooseAwareSlots(root, flat, box, index, ctx, fontCtx) {
49033
50043
  }
49034
50044
  const fitByRole = fontCtx ? resolveFitByDeclaringRole(fontCtx, slots) : /* @__PURE__ */ new Map();
49035
50045
  return slots.map(({ rect: rect3, content: content2, node: layoutNode, declaringRole }, i2) => {
49036
- const first2 = content2[0];
50046
+ const first3 = content2[0];
49037
50047
  const fit2 = fitByRole.get(declaringRole);
49038
50048
  const rendered = {
49039
50049
  ...presetBoxNode({
49040
- key: `${ctx.elementId}-comp-choose-${first2.id}-${i2}`,
50050
+ key: `${ctx.elementId}-comp-choose-${first3.id}-${i2}`,
49041
50051
  x: rect3.x,
49042
50052
  y: rect3.y,
49043
50053
  width: rect3.width,
49044
50054
  height: rect3.height,
49045
- node: first2,
50055
+ node: first3,
49046
50056
  index: i2,
49047
50057
  total: slots.length,
49048
50058
  palette: ctx.palette,
@@ -49097,16 +50107,16 @@ function renderForEachBoundSlots(slots, flat, box, absX, absY, childrenOf, ctx,
49097
50107
  return;
49098
50108
  }
49099
50109
  const rect3 = resolveSlot(slot2.dims, box, absX, absY);
49100
- const first2 = content2[0];
50110
+ const first3 = content2[0];
49101
50111
  const index = startIndex + offset;
49102
50112
  const entry3 = {
49103
50113
  ...rectNode({
49104
- key: `${ctx.elementId}-comp-feach-${first2.id}-${index}`,
50114
+ key: `${ctx.elementId}-comp-feach-${first3.id}-${index}`,
49105
50115
  x: rect3.x,
49106
50116
  y: rect3.y,
49107
50117
  width: rect3.width,
49108
50118
  height: rect3.height,
49109
- node: first2,
50119
+ node: first3,
49110
50120
  index,
49111
50121
  total: startIndex + slots.length,
49112
50122
  palette: ctx.palette,
@@ -49516,15 +50526,15 @@ function renderAnchoredPair(node, index, total, selfSlot, selfLayoutNode, desSlo
49516
50526
  })
49517
50527
  ];
49518
50528
  if (desSlot && desSlot.content.length > 0) {
49519
- const first2 = desSlot.content[0];
50529
+ const first3 = desSlot.content[0];
49520
50530
  const rendered = {
49521
50531
  ...presetBoxNode({
49522
- key: `${ctx.elementId}-comp-des-${first2.id}-${index}`,
50532
+ key: `${ctx.elementId}-comp-des-${first3.id}-${index}`,
49523
50533
  x: desSlot.rect.x,
49524
50534
  y: desSlot.rect.y,
49525
50535
  width: desSlot.rect.width,
49526
50536
  height: desSlot.rect.height,
49527
- node: first2,
50537
+ node: first3,
49528
50538
  index,
49529
50539
  total,
49530
50540
  palette: ctx.palette,
@@ -49878,9 +50888,9 @@ function resolveHierarchyItemNode(algorithmNode) {
49878
50888
  if (candidates.length === 0) {
49879
50889
  return void 0;
49880
50890
  }
49881
- const first2 = candidates[0];
49882
- if (candidates.length < 2 || !first2) {
49883
- return first2;
50891
+ const first3 = candidates[0];
50892
+ if (candidates.length < 2 || !first3) {
50893
+ return first3;
49884
50894
  }
49885
50895
  const allNames = new Set(
49886
50896
  candidates.map((c2) => c2.name).filter((n3) => n3 !== void 0)
@@ -49895,7 +50905,7 @@ function resolveHierarchyItemNode(algorithmNode) {
49895
50905
  return candidate;
49896
50906
  }
49897
50907
  }
49898
- return first2;
50908
+ return first3;
49899
50909
  }
49900
50910
 
49901
50911
  // diagram/hierarchy/smartart-hierarchy-shared.ts
@@ -52626,10 +53636,10 @@ function projectDiagramNodeText(node, styler, fallbackStyle, options2 = {}) {
52626
53636
  paragraphIndex,
52627
53637
  options2.bulletEnabled ?? false
52628
53638
  );
52629
- let first2 = true;
53639
+ let first3 = true;
52630
53640
  const push = (segment2) => {
52631
- segments.push(first2 ? { ...segment2, ...metadata } : segment2);
52632
- first2 = false;
53641
+ segments.push(first3 ? { ...segment2, ...metadata } : segment2);
53642
+ first3 = false;
52633
53643
  };
52634
53644
  for (const item2 of paragraph2.items) {
52635
53645
  if (item2.kind === "run") {
@@ -52653,7 +53663,7 @@ function projectDiagramNodeText(node, styler, fallbackStyle, options2 = {}) {
52653
53663
  push({ text: " ", style: pStyle });
52654
53664
  }
52655
53665
  }
52656
- if (first2) {
53666
+ if (first3) {
52657
53667
  push({ text: "", style: styler.endParagraphStyle(paragraph2, pStyle) });
52658
53668
  }
52659
53669
  if (paragraphIndex < paragraphs.length - 1) {
@@ -55000,7 +56010,7 @@ function parseDiagramLayoutSummary(source2) {
55000
56010
 
55001
56011
  // diagram/drawing-from-views.ts
55002
56012
  var scheme = (value) => ({ kind: "scheme", value, transforms: [] });
55003
- var srgb2 = (hex) => ({
56013
+ var srgb3 = (hex) => ({
55004
56014
  kind: "srgb",
55005
56015
  value: hex.replace("#", "").toUpperCase(),
55006
56016
  transforms: []
@@ -55011,11 +56021,11 @@ function diagramDrawingFromViews(views, options2 = {}) {
55011
56021
  let filled = 0;
55012
56022
  const shapes2 = views.map((view) => {
55013
56023
  const themed = !view.fillColor && !view.fillNone;
55014
- const fill = view.fillColor ? srgb2(view.fillColor) : scheme(accents[filled++ % accents.length]);
56024
+ const fill = view.fillColor ? srgb3(view.fillColor) : scheme(accents[filled++ % accents.length]);
55015
56025
  if (view.fillOpacity !== void 0 && view.fillOpacity < 1)
55016
56026
  fill.transforms.push({ name: "alpha", value: String(Math.round(view.fillOpacity * 1e5)) });
55017
56027
  const text3 = view.text?.trim() ? view.text : "";
55018
- const textColor = view.fontColor ? srgb2(view.fontColor) : scheme(themed ? "lt1" : "tx1");
56028
+ const textColor = view.fontColor ? srgb3(view.fontColor) : scheme(themed ? "lt1" : "tx1");
55019
56029
  return {
55020
56030
  modelId: view.id,
55021
56031
  frame: {
@@ -55030,7 +56040,7 @@ function diagramDrawingFromViews(views, options2 = {}) {
55030
56040
  fill: view.fillNone ? { kind: "none" } : { kind: "solid", color: fill },
55031
56041
  line: {
55032
56042
  widthEmu: view.strokeWidth === void 0 ? 12700 : view.strokeWidth * 12700,
55033
- fill: view.strokeColor === "none" ? { kind: "none" } : { kind: "solid", color: view.strokeColor ? srgb2(view.strokeColor) : scheme("lt1") }
56043
+ fill: view.strokeColor === "none" ? { kind: "none" } : { kind: "solid", color: view.strokeColor ? srgb3(view.strokeColor) : scheme("lt1") }
55034
56044
  },
55035
56045
  ...text3 ? {
55036
56046
  text: {
@@ -55391,64 +56401,6 @@ async function clonePartGraph(options2) {
55391
56401
  return copies;
55392
56402
  }
55393
56403
 
55394
- // opc/safe-href.ts
55395
- var SAFE_SCHEMES = /* @__PURE__ */ new Set(["http:", "https:", "mailto:"]);
55396
- function isSafeHyperlinkHref(href) {
55397
- const scheme2 = /^([a-z][a-z0-9+.-]*:)/i.exec(href.trim())?.[1];
55398
- return scheme2 !== void 0 && SAFE_SCHEMES.has(scheme2.toLowerCase());
55399
- }
55400
- var OPEN_SCHEMES = /* @__PURE__ */ new Set(["http", "https", "mailto"]);
55401
- var STORE_SCHEMES = /* @__PURE__ */ new Set([...OPEN_SCHEMES, "ftp", "file"]);
55402
- var SCRIPT_SCHEMES = /* @__PURE__ */ new Set([
55403
- "javascript",
55404
- "vbscript",
55405
- "livescript",
55406
- "jscript",
55407
- "mocha",
55408
- "data",
55409
- "mhtml",
55410
- "ms-its",
55411
- "mk",
55412
- "x-javascript",
55413
- "blob"
55414
- ]);
55415
- var IGNORABLE = new RegExp(
55416
- "[\\u0000-\\u0020\\u007f\\u00ad\\u200b-\\u200f\\u202a-\\u202e\\u2060-\\u2064\\ufeff]",
55417
- "gu"
55418
- );
55419
- var CONTROL = new RegExp("[\\u0000-\\u001f\\u007f]", "u");
55420
- var SCHEME = /^([a-z][a-z0-9+.-]*):/;
55421
- var STORE_ONLY = { store: true, open: false, reason: "not-openable" };
55422
- var reject = (reason) => ({
55423
- store: false,
55424
- open: false,
55425
- reason
55426
- });
55427
- function hyperlinkPolicy(href, options2 = {}) {
55428
- if (typeof href !== "string") return reject("empty");
55429
- const trimmed = href.trim();
55430
- const normalized = trimmed.replace(IGNORABLE, "").toLowerCase();
55431
- if (normalized.length === 0) return reject("empty");
55432
- const scheme2 = SCHEME.exec(normalized)?.[1];
55433
- if (scheme2 !== void 0 && SCRIPT_SCHEMES.has(scheme2)) return reject("script-scheme");
55434
- if (scheme2 !== void 0 && !trimmed.toLowerCase().startsWith(`${scheme2}:`))
55435
- return reject("obfuscated-scheme");
55436
- if (CONTROL.test(trimmed)) return reject("control-characters");
55437
- if (scheme2 === void 0) return options2.openRelative ? { store: true, open: true } : STORE_ONLY;
55438
- if (scheme2.length === 1) return STORE_ONLY;
55439
- if (OPEN_SCHEMES.has(scheme2)) return { store: true, open: true };
55440
- if (options2.additionalOpenSchemes?.some((allowed) => allowed.toLowerCase() === scheme2))
55441
- return { store: true, open: true };
55442
- if (STORE_SCHEMES.has(scheme2)) return STORE_ONLY;
55443
- return reject("unsupported-scheme");
55444
- }
55445
- function isStorableHyperlinkHref(href, options2) {
55446
- return hyperlinkPolicy(href, options2).store;
55447
- }
55448
- function isOpenableHyperlinkHref(href, options2) {
55449
- return hyperlinkPolicy(href, options2).open;
55450
- }
55451
-
55452
56404
  // opc/embedded-packages.ts
55453
56405
  var EMBEDDED_ZIP_LIMITS = {
55454
56406
  label: "Embedded",
@@ -55501,7 +56453,7 @@ var PROPERTY_CONTENT_TYPES = {
55501
56453
 
55502
56454
  // opc/properties/patch.ts
55503
56455
  var XMLNS = "http://www.w3.org/2000/xmlns/";
55504
- function tagEnd2(xml2, from) {
56456
+ function tagEnd3(xml2, from) {
55505
56457
  let quote = "";
55506
56458
  for (let i2 = from + 1; i2 < xml2.length; i2++) {
55507
56459
  const ch = xml2[i2];
@@ -55528,7 +56480,7 @@ function scan(xml2) {
55528
56480
  if (skipped !== void 0) i2 = skipped;
55529
56481
  else rootStart = lt;
55530
56482
  }
55531
- const openEnd = tagEnd2(xml2, rootStart);
56483
+ const openEnd = tagEnd3(xml2, rootStart);
55532
56484
  if (xml2[openEnd - 2] === "/") {
55533
56485
  const root = {
55534
56486
  start: rootStart,
@@ -55551,7 +56503,7 @@ function scan(xml2) {
55551
56503
  i2 = skipped;
55552
56504
  continue;
55553
56505
  }
55554
- const end = tagEnd2(xml2, lt);
56506
+ const end = tagEnd3(xml2, lt);
55555
56507
  i2 = end;
55556
56508
  if (xml2[lt + 1] === "/") {
55557
56509
  if (depth === 0) {
@@ -60591,9 +61543,9 @@ function buildCalloutLeaderLineSvgPath(geometry) {
60591
61543
  if (geometry.points.length < 2) {
60592
61544
  return "";
60593
61545
  }
60594
- const first2 = at(geometry.points, 0);
61546
+ const first3 = at(geometry.points, 0);
60595
61547
  const rest = geometry.points.slice(1);
60596
- const parts = [`M ${first2.x} ${first2.y}`];
61548
+ const parts = [`M ${first3.x} ${first3.y}`];
60597
61549
  for (const pt2 of rest) {
60598
61550
  parts.push(`L ${pt2.x} ${pt2.y}`);
60599
61551
  }
@@ -66464,9 +67416,9 @@ function svgPathToSegments(d) {
66464
67416
  let lastCubic;
66465
67417
  let lastQuad;
66466
67418
  const tokens = tokenizeSvgPath(d, { strict: true });
66467
- const first2 = tokens[0];
66468
- if (first2 && first2.type.toUpperCase() !== "M") {
66469
- throw new SyntaxError(`SVG path data must start with a moveto, not ${first2.type}`);
67419
+ const first3 = tokens[0];
67420
+ if (first3 && first3.type.toUpperCase() !== "M") {
67421
+ throw new SyntaxError(`SVG path data must start with a moveto, not ${first3.type}`);
66470
67422
  }
66471
67423
  for (const { type, values } of tokens) {
66472
67424
  const upper = type.toUpperCase();
@@ -66850,11 +67802,11 @@ function distributeElements(elements3, axis2, options2) {
66850
67802
  if (sorted.length < 3) {
66851
67803
  return result;
66852
67804
  }
66853
- const first2 = sorted[0];
67805
+ const first3 = sorted[0];
66854
67806
  const last = sorted[sorted.length - 1];
66855
- const span = start(last) + size(last) - start(first2);
67807
+ const span = start(last) + size(last) - start(first3);
66856
67808
  gap = (span - totalSize) / (sorted.length - 1);
66857
- cursor = start(first2);
67809
+ cursor = start(first3);
66858
67810
  }
66859
67811
  for (const el of sorted) {
66860
67812
  result.set(el.id, horizontal ? { x: cursor } : { y: cursor });