@openpresentation/opf 0.12.2 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (416) hide show
  1. package/README.md +28 -23
  2. package/dist/{catalogs-BnI7JKcn.d.ts → catalogs-D-yyQWCQ.d.ts} +86 -208
  3. package/dist/catalogs.d.ts +2 -2
  4. package/dist/catalogs.js +1 -1
  5. package/dist/chart-data-B_3z9VTb.d.ts +188 -0
  6. package/dist/chunk-4LDGKLUC.js +192 -0
  7. package/dist/{chunk-V2537ENL.js → chunk-4VJDTF55.js} +2 -90
  8. package/dist/chunk-5ZU6JAPP.js +83 -0
  9. package/dist/{chunk-HOBSL7AJ.js → chunk-6OXY2CP3.js} +3604 -1644
  10. package/dist/{chunk-RUC7L5DJ.js → chunk-BFLVSVA7.js} +26 -26
  11. package/dist/chunk-CSQHPVGL.js +94 -0
  12. package/dist/{chunk-GJKJL4YY.js → chunk-D3TY4TT6.js} +34 -412
  13. package/dist/chunk-JDJBDYSR.js +4167 -0
  14. package/dist/{chunk-4LAM3N6S.js → chunk-LS2FMPI5.js} +1497 -1097
  15. package/dist/{chunk-SOSOBKQ2.js → chunk-Q2TCMN56.js} +6 -7
  16. package/dist/chunk-UPQQD7MA.js +1840 -0
  17. package/dist/{chunk-AUM5MXBR.js → chunk-XIZUK2XM.js} +36 -32
  18. package/dist/{chunk-E34DJ5LL.js → chunk-XOZ4KMSR.js} +2427 -10820
  19. package/dist/chunk-Z65B2B77.js +601 -0
  20. package/dist/{composition-DWbCiMwF.d.ts → composition-_WEwBe2a.d.ts} +744 -26
  21. package/dist/composition.d.ts +2 -1
  22. package/dist/composition.js +2 -2
  23. package/dist/convert.d.ts +9 -4
  24. package/dist/convert.js +57 -26
  25. package/dist/data.d.ts +5 -4
  26. package/dist/data.js +3 -1
  27. package/dist/diff.d.ts +5 -5
  28. package/dist/diff.js +6 -603
  29. package/dist/docs.js +70 -52
  30. package/dist/examples.d.ts +1 -1
  31. package/dist/examples.js +1466 -2963
  32. package/dist/finding-C_por275.d.ts +212 -0
  33. package/dist/format.d.ts +4 -4
  34. package/dist/format.js +2 -83
  35. package/dist/index.d.ts +318 -281
  36. package/dist/index.js +530 -943
  37. package/dist/markdown.d.ts +28 -25
  38. package/dist/markdown.js +8 -1940
  39. package/dist/pagination-BZpXLvFL.d.ts +119 -0
  40. package/dist/pagination.d.ts +5 -60
  41. package/dist/pagination.js +5 -5
  42. package/dist/patch.d.ts +12 -23
  43. package/dist/patch.js +5 -5
  44. package/dist/{presentation-DcF-MZcz.d.ts → presentation-C5eHkevA.d.ts} +516 -499
  45. package/dist/repo-readme.js +1 -1
  46. package/dist/{schemas-BSjlG8-R.d.ts → schemas-DDpqAgyS.d.ts} +49 -17
  47. package/dist/schemas.d.ts +1 -1
  48. package/dist/schemas.js +1 -1
  49. package/dist/spec/README.md +10 -5
  50. package/dist/spec/catalogs/audiences/index.json +2 -50
  51. package/dist/spec/catalogs/chart-types/100pct-stacked-area.json +21 -0
  52. package/dist/spec/catalogs/chart-types/100pct-stacked-bar.json +22 -0
  53. package/dist/spec/catalogs/chart-types/100pct-stacked-column.json +22 -0
  54. package/dist/spec/catalogs/chart-types/area.json +2 -60
  55. package/dist/spec/catalogs/chart-types/bar.json +2 -48
  56. package/dist/spec/catalogs/chart-types/box-and-whisker.json +2 -132
  57. package/dist/spec/catalogs/chart-types/column.json +2 -52
  58. package/dist/spec/catalogs/chart-types/combo.json +37 -0
  59. package/dist/spec/catalogs/chart-types/doughnut.json +2 -40
  60. package/dist/spec/catalogs/chart-types/filled-radar.json +2 -52
  61. package/dist/spec/catalogs/chart-types/funnel.json +2 -46
  62. package/dist/spec/catalogs/chart-types/histogram.json +2 -149
  63. package/dist/spec/catalogs/chart-types/index.json +50 -520
  64. package/dist/spec/catalogs/chart-types/line-with-markers.json +2 -60
  65. package/dist/spec/catalogs/chart-types/line.json +2 -60
  66. package/dist/spec/catalogs/chart-types/pareto.json +2 -50
  67. package/dist/spec/catalogs/chart-types/pie.json +2 -40
  68. package/dist/spec/catalogs/chart-types/radar-with-markers.json +2 -52
  69. package/dist/spec/catalogs/chart-types/radar.json +2 -52
  70. package/dist/spec/catalogs/chart-types/scatter.json +2 -73
  71. package/dist/spec/catalogs/chart-types/stacked-area.json +21 -0
  72. package/dist/spec/catalogs/chart-types/stacked-bar.json +22 -0
  73. package/dist/spec/catalogs/chart-types/stacked-column.json +22 -0
  74. package/dist/spec/catalogs/chart-types/stacked-line-with-markers.json +22 -0
  75. package/dist/spec/catalogs/chart-types/stacked-line.json +21 -0
  76. package/dist/spec/catalogs/chart-types/treemap.json +2 -48
  77. package/dist/spec/catalogs/chart-types/waterfall.json +2 -52
  78. package/dist/spec/catalogs/chart-types/world.json +2 -64
  79. package/dist/spec/catalogs/font-schemes/angsana-new.json +2 -2
  80. package/dist/spec/catalogs/font-schemes/aparajita.json +3 -3
  81. package/dist/spec/catalogs/font-schemes/aptos.json +1 -1
  82. package/dist/spec/catalogs/font-schemes/arabic-typesetting.json +2 -2
  83. package/dist/spec/catalogs/font-schemes/arial.json +1 -1
  84. package/dist/spec/catalogs/font-schemes/batang.json +2 -2
  85. package/dist/spec/catalogs/font-schemes/bookman.json +1 -1
  86. package/dist/spec/catalogs/font-schemes/calibri.json +1 -1
  87. package/dist/spec/catalogs/font-schemes/century-schoolbook.json +1 -1
  88. package/dist/spec/catalogs/font-schemes/consolas.json +2 -4
  89. package/dist/spec/catalogs/font-schemes/constantia.json +1 -1
  90. package/dist/spec/catalogs/font-schemes/courier-new.json +2 -4
  91. package/dist/spec/catalogs/font-schemes/daunpenh.json +2 -2
  92. package/dist/spec/catalogs/font-schemes/david.json +2 -2
  93. package/dist/spec/catalogs/font-schemes/dilleniaupc.json +2 -2
  94. package/dist/spec/catalogs/font-schemes/fangsong.json +2 -2
  95. package/dist/spec/catalogs/font-schemes/garamond.json +1 -1
  96. package/dist/spec/catalogs/font-schemes/gautami.json +2 -2
  97. package/dist/spec/catalogs/font-schemes/georgia.json +1 -1
  98. package/dist/spec/catalogs/font-schemes/gisha.json +3 -3
  99. package/dist/spec/catalogs/font-schemes/grandview.json +1 -1
  100. package/dist/spec/catalogs/font-schemes/gungsuh.json +2 -2
  101. package/dist/spec/catalogs/font-schemes/impact.json +1 -1
  102. package/dist/spec/catalogs/font-schemes/index.json +1 -1
  103. package/dist/spec/catalogs/font-schemes/kalinga.json +2 -2
  104. package/dist/spec/catalogs/font-schemes/kartika.json +2 -2
  105. package/dist/spec/catalogs/font-schemes/khmer-ui.json +2 -2
  106. package/dist/spec/catalogs/font-schemes/latha.json +2 -2
  107. package/dist/spec/catalogs/font-schemes/lucida-sans.json +1 -1
  108. package/dist/spec/catalogs/font-schemes/malgun-gothic.json +2 -2
  109. package/dist/spec/catalogs/font-schemes/mangal.json +4 -5
  110. package/dist/spec/catalogs/font-schemes/meiryo.json +2 -2
  111. package/dist/spec/catalogs/font-schemes/microsoft-jhenghei.json +2 -2
  112. package/dist/spec/catalogs/font-schemes/microsoft-yahei.json +5 -5
  113. package/dist/spec/catalogs/font-schemes/mingliu.json +2 -2
  114. package/dist/spec/catalogs/font-schemes/miriam.json +2 -2
  115. package/dist/spec/catalogs/font-schemes/montserrat.json +1 -1
  116. package/dist/spec/catalogs/font-schemes/ms-mincho.json +2 -2
  117. package/dist/spec/catalogs/font-schemes/nirmala-ui.json +2 -2
  118. package/dist/spec/catalogs/font-schemes/noto-naksh-arabic.json +2 -2
  119. package/dist/spec/catalogs/font-schemes/noto-nastaliq-urdu.json +3 -3
  120. package/dist/spec/catalogs/font-schemes/noto-sans-arabic.json +4 -4
  121. package/dist/spec/catalogs/font-schemes/noto-sans-armenian.json +2 -2
  122. package/dist/spec/catalogs/font-schemes/noto-sans-bengali.json +3 -3
  123. package/dist/spec/catalogs/font-schemes/noto-sans-devangari.json +3 -3
  124. package/dist/spec/catalogs/font-schemes/noto-sans-ethiopic.json +2 -2
  125. package/dist/spec/catalogs/font-schemes/noto-sans-georgian.json +2 -2
  126. package/dist/spec/catalogs/font-schemes/noto-sans-gujarati.json +2 -2
  127. package/dist/spec/catalogs/font-schemes/noto-sans-gurmukhi.json +2 -2
  128. package/dist/spec/catalogs/font-schemes/noto-sans-hebrew.json +2 -2
  129. package/dist/spec/catalogs/font-schemes/noto-sans-jp.json +2 -2
  130. package/dist/spec/catalogs/font-schemes/noto-sans-kannada.json +2 -2
  131. package/dist/spec/catalogs/font-schemes/noto-sans-khmer.json +2 -2
  132. package/dist/spec/catalogs/font-schemes/noto-sans-kr.json +2 -2
  133. package/dist/spec/catalogs/font-schemes/noto-sans-malayalam.json +2 -2
  134. package/dist/spec/catalogs/font-schemes/noto-sans-mongolian.json +2 -2
  135. package/dist/spec/catalogs/font-schemes/noto-sans-oriya.json +2 -2
  136. package/dist/spec/catalogs/font-schemes/noto-sans-sc.json +5 -5
  137. package/dist/spec/catalogs/font-schemes/noto-sans-tamil.json +2 -2
  138. package/dist/spec/catalogs/font-schemes/noto-sans-tc.json +2 -2
  139. package/dist/spec/catalogs/font-schemes/noto-sans-telugu.json +2 -2
  140. package/dist/spec/catalogs/font-schemes/noto-sans-thai.json +2 -2
  141. package/dist/spec/catalogs/font-schemes/noto-sans.json +5 -5
  142. package/dist/spec/catalogs/font-schemes/nyala.json +2 -2
  143. package/dist/spec/catalogs/font-schemes/open-sans.json +1 -1
  144. package/dist/spec/catalogs/font-schemes/pmingliu.json +2 -2
  145. package/dist/spec/catalogs/font-schemes/poppins.json +1 -1
  146. package/dist/spec/catalogs/font-schemes/pt-serif.json +1 -1
  147. package/dist/spec/catalogs/font-schemes/raavi.json +2 -2
  148. package/dist/spec/catalogs/font-schemes/raleway.json +1 -1
  149. package/dist/spec/catalogs/font-schemes/roboto.json +1 -1
  150. package/dist/spec/catalogs/font-schemes/rockwell.json +1 -1
  151. package/dist/spec/catalogs/font-schemes/sakkal-majalla.json +4 -4
  152. package/dist/spec/catalogs/font-schemes/seaford.json +1 -1
  153. package/dist/spec/catalogs/font-schemes/segoe-ui-light.json +1 -1
  154. package/dist/spec/catalogs/font-schemes/segoe-ui.json +1 -1
  155. package/dist/spec/catalogs/font-schemes/shonar-bangla.json +3 -3
  156. package/dist/spec/catalogs/font-schemes/shruti.json +2 -2
  157. package/dist/spec/catalogs/font-schemes/simsun.json +2 -2
  158. package/dist/spec/catalogs/font-schemes/skeena.json +1 -1
  159. package/dist/spec/catalogs/font-schemes/sylfaen.json +3 -3
  160. package/dist/spec/catalogs/font-schemes/tahoma.json +1 -1
  161. package/dist/spec/catalogs/font-schemes/tenorite.json +1 -1
  162. package/dist/spec/catalogs/font-schemes/times-new-roman.json +1 -1
  163. package/dist/spec/catalogs/font-schemes/traditional-arabic.json +4 -4
  164. package/dist/spec/catalogs/font-schemes/trebuchet-ms.json +1 -1
  165. package/dist/spec/catalogs/font-schemes/tunga.json +2 -2
  166. package/dist/spec/catalogs/font-schemes/verdana.json +1 -1
  167. package/dist/spec/catalogs/font-schemes/vrinda.json +2 -2
  168. package/dist/spec/catalogs/font-schemes/yu-gothic.json +2 -2
  169. package/dist/spec/catalogs/layouts/action-plan.json +9 -15
  170. package/dist/spec/catalogs/layouts/agenda.json +8 -15
  171. package/dist/spec/catalogs/layouts/appendix-index.json +7 -15
  172. package/dist/spec/catalogs/layouts/architecture-stack.json +9 -15
  173. package/dist/spec/catalogs/layouts/assumptions-dependencies.json +9 -15
  174. package/dist/spec/catalogs/layouts/before-after.json +9 -15
  175. package/dist/spec/catalogs/layouts/benchmark-target-table.json +9 -15
  176. package/dist/spec/catalogs/layouts/blank.json +11 -1
  177. package/dist/spec/catalogs/layouts/bullet-list.json +9 -15
  178. package/dist/spec/catalogs/layouts/business-model-canvas.json +9 -15
  179. package/dist/spec/catalogs/layouts/capability-map.json +14 -16
  180. package/dist/spec/catalogs/layouts/case-study.json +9 -15
  181. package/dist/spec/catalogs/layouts/chapter-recap.json +8 -15
  182. package/dist/spec/catalogs/layouts/chart-1x.json +15 -0
  183. package/dist/spec/catalogs/layouts/chart-2x.json +15 -0
  184. package/dist/spec/catalogs/layouts/chart-3x.json +15 -0
  185. package/dist/spec/catalogs/layouts/circular-lifecycle.json +9 -15
  186. package/dist/spec/catalogs/layouts/code-1x.json +10 -0
  187. package/dist/spec/catalogs/layouts/comparison.json +9 -15
  188. package/dist/spec/catalogs/layouts/competitive-landscape.json +14 -16
  189. package/dist/spec/catalogs/layouts/customer-journey.json +14 -16
  190. package/dist/spec/catalogs/layouts/customer-logos.json +9 -15
  191. package/dist/spec/catalogs/layouts/dashboard.json +9 -15
  192. package/dist/spec/catalogs/layouts/data-visualization.json +9 -15
  193. package/dist/spec/catalogs/layouts/decision-tree.json +14 -16
  194. package/dist/spec/catalogs/layouts/detailed-data-table.json +9 -15
  195. package/dist/spec/catalogs/layouts/ecosystem-map.json +14 -16
  196. package/dist/spec/catalogs/layouts/executive-decision.json +9 -15
  197. package/dist/spec/catalogs/layouts/executive-summary.json +9 -15
  198. package/dist/spec/catalogs/layouts/extract/canonical.json +8 -8
  199. package/dist/spec/catalogs/layouts/faq.json +9 -15
  200. package/dist/spec/catalogs/layouts/feature-comparison-matrix.json +9 -15
  201. package/dist/spec/catalogs/layouts/forecast-scenario.json +9 -15
  202. package/dist/spec/catalogs/layouts/funnel-pyramid.json +9 -15
  203. package/dist/spec/catalogs/layouts/gantt-project-plan.json +9 -15
  204. package/dist/spec/catalogs/layouts/geographic-map.json +13 -15
  205. package/dist/spec/catalogs/layouts/heatmap-cohort.json +9 -15
  206. package/dist/spec/catalogs/layouts/hub-and-spoke.json +9 -15
  207. package/dist/spec/catalogs/layouts/icon-grid.json +14 -16
  208. package/dist/spec/catalogs/layouts/image-1x.json +11 -1
  209. package/dist/spec/catalogs/layouts/image-2x.json +12 -2
  210. package/dist/spec/catalogs/layouts/image-3x.json +13 -3
  211. package/dist/spec/catalogs/layouts/image-bleed.json +12 -2
  212. package/dist/spec/catalogs/layouts/image-focus.json +14 -16
  213. package/dist/spec/catalogs/layouts/index.json +1 -1
  214. package/dist/spec/catalogs/layouts/key-takeaway.json +8 -15
  215. package/dist/spec/catalogs/layouts/kpi-scorecard.json +9 -15
  216. package/dist/spec/catalogs/layouts/list-1x.json +17 -1
  217. package/dist/spec/catalogs/layouts/list-2x.json +16 -0
  218. package/dist/spec/catalogs/layouts/list-3x.json +16 -0
  219. package/dist/spec/catalogs/layouts/list-4x.json +16 -0
  220. package/dist/spec/catalogs/layouts/list-5x.json +16 -0
  221. package/dist/spec/catalogs/layouts/list-6x.json +16 -0
  222. package/dist/spec/catalogs/layouts/logic-tree.json +9 -15
  223. package/dist/spec/catalogs/layouts/market-size.json +9 -15
  224. package/dist/spec/catalogs/layouts/matrix-quadrant.json +9 -15
  225. package/dist/spec/catalogs/layouts/media-1x.json +11 -1
  226. package/dist/spec/catalogs/layouts/network-dependency-map.json +13 -15
  227. package/dist/spec/catalogs/layouts/number-1x.json +16 -1
  228. package/dist/spec/catalogs/layouts/number-2x.json +15 -0
  229. package/dist/spec/catalogs/layouts/number-3x.json +15 -0
  230. package/dist/spec/catalogs/layouts/number-4x.json +15 -0
  231. package/dist/spec/catalogs/layouts/number-5x.json +15 -0
  232. package/dist/spec/catalogs/layouts/number-6x.json +15 -0
  233. package/dist/spec/catalogs/layouts/one-column-explainer.json +9 -15
  234. package/dist/spec/catalogs/layouts/org-chart.json +9 -15
  235. package/dist/spec/catalogs/layouts/persona-grid.json +14 -16
  236. package/dist/spec/catalogs/layouts/photo-grid.json +17 -19
  237. package/dist/spec/catalogs/layouts/pricing-table.json +9 -15
  238. package/dist/spec/catalogs/layouts/process-flow.json +9 -15
  239. package/dist/spec/catalogs/layouts/product-feature.json +14 -16
  240. package/dist/spec/catalogs/layouts/pros-cons.json +9 -15
  241. package/dist/spec/catalogs/layouts/qa-discussion.json +7 -15
  242. package/dist/spec/catalogs/layouts/quote-1x.json +11 -1
  243. package/dist/spec/catalogs/layouts/quote-highlight.json +9 -15
  244. package/dist/spec/catalogs/layouts/raci-matrix.json +9 -15
  245. package/dist/spec/catalogs/layouts/risk-heatmap.json +9 -15
  246. package/dist/spec/catalogs/layouts/roadmap.json +9 -15
  247. package/dist/spec/catalogs/layouts/screenshot-walkthrough.json +14 -16
  248. package/dist/spec/catalogs/layouts/section-divider.json +8 -15
  249. package/dist/spec/catalogs/layouts/single-message-statement.json +8 -15
  250. package/dist/spec/catalogs/layouts/stats-metrics.json +9 -15
  251. package/dist/spec/catalogs/layouts/status-rag.json +9 -15
  252. package/dist/spec/catalogs/layouts/swimlane-process.json +14 -16
  253. package/dist/spec/catalogs/layouts/swot-analysis.json +9 -15
  254. package/dist/spec/catalogs/layouts/table-1x.json +10 -0
  255. package/dist/spec/catalogs/layouts/team-bio.json +14 -16
  256. package/dist/spec/catalogs/layouts/testimonial-grid.json +9 -15
  257. package/dist/spec/catalogs/layouts/text-1x.json +11 -1
  258. package/dist/spec/catalogs/layouts/text-2x.json +10 -0
  259. package/dist/spec/catalogs/layouts/text-3x.json +10 -0
  260. package/dist/spec/catalogs/layouts/thank-you-cta.json +8 -15
  261. package/dist/spec/catalogs/layouts/three-column.json +9 -15
  262. package/dist/spec/catalogs/layouts/timeline-1x.json +11 -1
  263. package/dist/spec/catalogs/layouts/timeline.json +9 -15
  264. package/dist/spec/catalogs/layouts/title-slide.json +8 -15
  265. package/dist/spec/catalogs/layouts/title-subtitle.json +11 -1
  266. package/dist/spec/catalogs/layouts/title.json +11 -1
  267. package/dist/spec/catalogs/layouts/two-column.json +9 -15
  268. package/dist/spec/catalogs/layouts/venn-overlap.json +9 -15
  269. package/dist/spec/catalogs/layouts/waterfall-bridge.json +9 -15
  270. package/dist/spec/catalogs/layouts/wheel-radial.json +9 -15
  271. package/dist/spec/catalogs/manifest.json +11 -11
  272. package/dist/spec/catalogs/narratives/board-meeting.json +45 -45
  273. package/dist/spec/catalogs/narratives/business-narrative.json +19 -19
  274. package/dist/spec/catalogs/narratives/business-review.json +27 -27
  275. package/dist/spec/catalogs/narratives/capacity-planning.json +19 -19
  276. package/dist/spec/catalogs/narratives/challenge-resolution.json +17 -17
  277. package/dist/spec/catalogs/narratives/change-story.json +13 -13
  278. package/dist/spec/catalogs/narratives/classic-story.json +17 -17
  279. package/dist/spec/catalogs/narratives/company-intro.json +21 -21
  280. package/dist/spec/catalogs/narratives/conference-talk.json +4 -4
  281. package/dist/spec/catalogs/narratives/data-story.json +13 -14
  282. package/dist/spec/catalogs/narratives/early-startup-pitch.json +27 -27
  283. package/dist/spec/catalogs/narratives/educate.json +21 -21
  284. package/dist/spec/catalogs/narratives/employee-review.json +19 -19
  285. package/dist/spec/catalogs/narratives/failure-analysis.json +23 -23
  286. package/dist/spec/catalogs/narratives/focus.json +27 -27
  287. package/dist/spec/catalogs/narratives/golden-circle.json +4 -4
  288. package/dist/spec/catalogs/narratives/heros-journey.json +13 -13
  289. package/dist/spec/catalogs/narratives/index.json +145 -145
  290. package/dist/spec/catalogs/narratives/innovation.json +21 -21
  291. package/dist/spec/catalogs/narratives/justice.json +25 -25
  292. package/dist/spec/catalogs/narratives/marketing-strategy.json +25 -25
  293. package/dist/spec/catalogs/narratives/performance-improvement-plan.json +19 -19
  294. package/dist/spec/catalogs/narratives/performance-review.json +25 -25
  295. package/dist/spec/catalogs/narratives/persuade.json +17 -17
  296. package/dist/spec/catalogs/narratives/persuasive-sales.json +19 -19
  297. package/dist/spec/catalogs/narratives/pitch-deck.json +6 -6
  298. package/dist/spec/catalogs/narratives/problem-solution.json +5 -5
  299. package/dist/spec/catalogs/narratives/product-launch.json +23 -23
  300. package/dist/spec/catalogs/narratives/project-proposal.json +23 -23
  301. package/dist/spec/catalogs/narratives/pyramid-principle.json +9 -9
  302. package/dist/spec/catalogs/narratives/qbr.json +8 -8
  303. package/dist/spec/catalogs/narratives/rags-to-riches.json +17 -17
  304. package/dist/spec/catalogs/narratives/reveal.json +19 -19
  305. package/dist/spec/catalogs/narratives/scqa.json +4 -4
  306. package/dist/spec/catalogs/narratives/situation-complication-resolution.json +11 -11
  307. package/dist/spec/catalogs/narratives/sparkline.json +11 -11
  308. package/dist/spec/catalogs/narratives/star-method.json +11 -11
  309. package/dist/spec/catalogs/narratives/status-update.json +15 -15
  310. package/dist/spec/catalogs/narratives/strategic-advisory.json +17 -17
  311. package/dist/spec/catalogs/narratives/strategic-narrative.json +4 -4
  312. package/dist/spec/catalogs/narratives/survey-analysis.json +23 -23
  313. package/dist/spec/catalogs/narratives/survival-story.json +23 -23
  314. package/dist/spec/catalogs/narratives/transformation-arc.json +4 -4
  315. package/dist/spec/catalogs/narratives/trend-analysis.json +17 -17
  316. package/dist/spec/catalogs/narratives/underdog-victory.json +19 -19
  317. package/dist/spec/catalogs/narratives/venture-pitch.json +27 -27
  318. package/dist/spec/catalogs/narratives/vision-roadmap.json +13 -13
  319. package/dist/spec/catalogs/narratives/weekly-progress.json +23 -23
  320. package/dist/spec/catalogs/narratives/what-so-what-now-what.json +9 -9
  321. package/dist/spec/openapi.yaml +2 -5
  322. package/dist/spec/reference/engine-defaults.json +2 -2
  323. package/dist/spec/schemas/audience.schema.json +1 -1
  324. package/dist/spec/schemas/catalog-index.schema.json +2 -2
  325. package/dist/spec/schemas/chart-type.schema.json +19 -290
  326. package/dist/spec/schemas/color-scheme.schema.json +20 -12
  327. package/dist/spec/schemas/finding.schema.json +191 -0
  328. package/dist/spec/schemas/font-scheme.schema.json +19 -46
  329. package/dist/spec/schemas/layout.schema.json +100 -159
  330. package/dist/spec/schemas/narrative.schema.json +17 -25
  331. package/dist/spec/schemas/opf.schema.json +503 -339
  332. package/dist/spec/schemas/social-platform.schema.json +1 -26
  333. package/dist/spec/schemas/theme.schema.json +4 -1
  334. package/dist/spec-files.d.ts +1 -1
  335. package/dist/spec-files.js +1 -1
  336. package/dist/symbol-font-encodings.js +18448 -1
  337. package/dist/types.d.ts +4 -4
  338. package/dist/validation-types-zh03LeZy.d.ts +276 -0
  339. package/dist/validator.d.ts +60 -4
  340. package/dist/validator.js +4 -4
  341. package/dist/yaml.d.ts +87 -0
  342. package/dist/yaml.js +321 -0
  343. package/package.json +6 -10
  344. package/dist/audit.d.ts +0 -156
  345. package/dist/audit.js +0 -7
  346. package/dist/chunk-6LZK2IZB.js +0 -1690
  347. package/dist/chunk-FYLJVF7X.js +0 -18448
  348. package/dist/chunk-JKVKYVWL.js +0 -1332
  349. package/dist/chunk-MWPMJE6P.js +0 -622
  350. package/dist/lint.d.ts +0 -70
  351. package/dist/lint.js +0 -6
  352. package/dist/spec/catalogs/audiences/customers.json +0 -27
  353. package/dist/spec/catalogs/audiences/executives.json +0 -27
  354. package/dist/spec/catalogs/audiences/investors.json +0 -27
  355. package/dist/spec/catalogs/audiences/marketing-team.json +0 -27
  356. package/dist/spec/catalogs/audiences/regulators.json +0 -27
  357. package/dist/spec/catalogs/audiences/sales-team.json +0 -27
  358. package/dist/spec/catalogs/chart-types/100pct-bullet-bar-2x.json +0 -91
  359. package/dist/spec/catalogs/chart-types/100pct-bullet-bar-3x.json +0 -103
  360. package/dist/spec/catalogs/chart-types/100pct-bullet-bar.json +0 -79
  361. package/dist/spec/catalogs/chart-types/100pct-bullet-column-2x.json +0 -91
  362. package/dist/spec/catalogs/chart-types/100pct-bullet-column-3x.json +0 -103
  363. package/dist/spec/catalogs/chart-types/100pct-bullet-column.json +0 -79
  364. package/dist/spec/catalogs/chart-types/100pct-progress-bar.json +0 -105
  365. package/dist/spec/catalogs/chart-types/100pct-stacked-area-2x.json +0 -106
  366. package/dist/spec/catalogs/chart-types/100pct-stacked-area-3x.json +0 -123
  367. package/dist/spec/catalogs/chart-types/100pct-stacked-bar-2x.json +0 -89
  368. package/dist/spec/catalogs/chart-types/100pct-stacked-bar-3x.json +0 -100
  369. package/dist/spec/catalogs/chart-types/100pct-stacked-column-2x.json +0 -95
  370. package/dist/spec/catalogs/chart-types/100pct-stacked-column-3x.json +0 -108
  371. package/dist/spec/catalogs/chart-types/australia.json +0 -76
  372. package/dist/spec/catalogs/chart-types/box-and-whisker-2x.json +0 -136
  373. package/dist/spec/catalogs/chart-types/box-and-whisker-3x.json +0 -168
  374. package/dist/spec/catalogs/chart-types/bullet-bar-2x.json +0 -89
  375. package/dist/spec/catalogs/chart-types/bullet-bar-3x.json +0 -101
  376. package/dist/spec/catalogs/chart-types/bullet-bar.json +0 -77
  377. package/dist/spec/catalogs/chart-types/bullet-column-2x.json +0 -89
  378. package/dist/spec/catalogs/chart-types/bullet-column-3x.json +0 -101
  379. package/dist/spec/catalogs/chart-types/bullet-column.json +0 -77
  380. package/dist/spec/catalogs/chart-types/canada.json +0 -86
  381. package/dist/spec/catalogs/chart-types/clustered-bar-2x.json +0 -89
  382. package/dist/spec/catalogs/chart-types/clustered-column.json +0 -95
  383. package/dist/spec/catalogs/chart-types/dot-plot-2x.json +0 -99
  384. package/dist/spec/catalogs/chart-types/dot-plot-3x.json +0 -124
  385. package/dist/spec/catalogs/chart-types/dot-plot-4x.json +0 -149
  386. package/dist/spec/catalogs/chart-types/dot-plot-5x.json +0 -174
  387. package/dist/spec/catalogs/chart-types/dot-plot-6x.json +0 -199
  388. package/dist/spec/catalogs/chart-types/dot-plot.json +0 -74
  389. package/dist/spec/catalogs/chart-types/dumbbell.json +0 -120
  390. package/dist/spec/catalogs/chart-types/line-2x.json +0 -105
  391. package/dist/spec/catalogs/chart-types/line-3x.json +0 -127
  392. package/dist/spec/catalogs/chart-types/line-with-high-low-and-markers.json +0 -144
  393. package/dist/spec/catalogs/chart-types/line-with-high-low.json +0 -144
  394. package/dist/spec/catalogs/chart-types/line-with-markers-2x.json +0 -106
  395. package/dist/spec/catalogs/chart-types/line-with-markers-3x.json +0 -128
  396. package/dist/spec/catalogs/chart-types/sparkline-2x.json +0 -138
  397. package/dist/spec/catalogs/chart-types/sparkline-3x.json +0 -174
  398. package/dist/spec/catalogs/chart-types/sparkline-4x.json +0 -210
  399. package/dist/spec/catalogs/chart-types/sparkline-5x.json +0 -246
  400. package/dist/spec/catalogs/chart-types/sparkline-6x.json +0 -282
  401. package/dist/spec/catalogs/chart-types/sparkline.json +0 -102
  402. package/dist/spec/catalogs/chart-types/stacked-area-2x.json +0 -106
  403. package/dist/spec/catalogs/chart-types/stacked-area-3x.json +0 -123
  404. package/dist/spec/catalogs/chart-types/stacked-bar-2x.json +0 -89
  405. package/dist/spec/catalogs/chart-types/stacked-bar-3x.json +0 -100
  406. package/dist/spec/catalogs/chart-types/stacked-column-2x.json +0 -95
  407. package/dist/spec/catalogs/chart-types/stacked-column-3x.json +0 -108
  408. package/dist/spec/catalogs/chart-types/stacked-line-2x.json +0 -106
  409. package/dist/spec/catalogs/chart-types/stacked-line-3x.json +0 -123
  410. package/dist/spec/catalogs/chart-types/stacked-line-with-markers-2x.json +0 -107
  411. package/dist/spec/catalogs/chart-types/stacked-line-with-markers-3x.json +0 -124
  412. package/dist/spec/catalogs/chart-types/treemap-2x.json +0 -101
  413. package/dist/spec/catalogs/chart-types/treemap-3x.json +0 -122
  414. package/dist/spec/catalogs/chart-types/united-kingdom.json +0 -68
  415. package/dist/spec/catalogs/chart-types/united-states.json +0 -82
  416. package/dist/validator-DfG9yxba.d.ts +0 -172
@@ -0,0 +1,601 @@
1
+ import { jsonEqual, formatPointer } from './chunk-BFLVSVA7.js';
2
+ import { annotationText } from './chunk-6OXY2CP3.js';
3
+
4
+ // src/diff-match.ts
5
+ var DEFAULT_MATCH_THRESHOLD = 0.5;
6
+ var DIFFERENT_ID_THRESHOLD = 0.8;
7
+ var MAX_SIMILARITY_PAIRS = 25e4;
8
+ var MAX_LCS_CELLS = 4e6;
9
+ var isObject = (value) => !!value && typeof value === "object" && !Array.isArray(value);
10
+ var isComposite = (value) => !!value && typeof value === "object";
11
+ var idOf = (value) => isObject(value) && typeof value.id === "string" && value.id !== "" ? value.id : void 0;
12
+ var canonCache = /* @__PURE__ */ new WeakMap();
13
+ function canonical(value) {
14
+ if (value === null || typeof value !== "object") return JSON.stringify(value) ?? "undefined";
15
+ const cached = canonCache.get(value);
16
+ if (cached !== void 0) return cached;
17
+ const text = Array.isArray(value) ? `[${value.map(canonical).join(",")}]` : `{${Object.keys(value).sort().map((key) => `${JSON.stringify(key)}:${canonical(value[key])}`).join(",")}}`;
18
+ canonCache.set(value, text);
19
+ return text;
20
+ }
21
+ var leafCache = /* @__PURE__ */ new WeakMap();
22
+ function leaves(value) {
23
+ if (!isComposite(value)) return /* @__PURE__ */ new Map();
24
+ const cached = leafCache.get(value);
25
+ if (cached) return cached;
26
+ const out = /* @__PURE__ */ new Map();
27
+ const walk = (node, path) => {
28
+ if (Array.isArray(node)) {
29
+ for (const [i, item] of node.entries()) walk(item, `${path}/${i}`);
30
+ } else if (node && typeof node === "object") for (const key of Object.keys(node)) walk(node[key], `${path}/${key}`);
31
+ else out.set(path, node);
32
+ };
33
+ walk(value, "");
34
+ leafCache.set(value, out);
35
+ return out;
36
+ }
37
+ var words = (text) => new Set(text.toLowerCase().split(/\s+/u).filter(Boolean));
38
+ function wordOverlap(a, b) {
39
+ const left = words(a), right = words(b);
40
+ if (!left.size || !right.size) return 0;
41
+ let shared = 0;
42
+ for (const word of left) if (right.has(word)) shared++;
43
+ return shared / (left.size + right.size - shared);
44
+ }
45
+ function similarity(a, b) {
46
+ if (canonical(a) === canonical(b)) return 1;
47
+ const left = leaves(a), right = leaves(b);
48
+ const size = Math.max(left.size, right.size);
49
+ if (!size) return 0;
50
+ let score = 0;
51
+ for (const [path, value] of left) {
52
+ if (!right.has(path)) continue;
53
+ const other = right.get(path);
54
+ if (value === other) score += 1;
55
+ else if (typeof value === "string" && typeof other === "string") score += 0.5 * wordOverlap(value, other);
56
+ }
57
+ return score / size;
58
+ }
59
+ function longestIncreasing(values) {
60
+ const tails = [], previous = new Array(values.length).fill(-1);
61
+ for (let i = 0; i < values.length; i++) {
62
+ let lo = 0, hi = tails.length;
63
+ while (lo < hi) {
64
+ const mid = lo + hi >> 1;
65
+ if (values[tails[mid]] < values[i]) lo = mid + 1;
66
+ else hi = mid;
67
+ }
68
+ if (lo > 0) previous[i] = tails[lo - 1];
69
+ tails[lo] = i;
70
+ }
71
+ const chain = [];
72
+ for (let at = tails.length ? tails[tails.length - 1] : -1; at >= 0; at = previous[at]) chain.push(at);
73
+ return chain.reverse();
74
+ }
75
+ function lcsPairs(keysA, keysB) {
76
+ const n = keysA.length, m = keysB.length;
77
+ if (!n || !m) return [];
78
+ if (n * m > MAX_LCS_CELLS) {
79
+ const pairs2 = [];
80
+ let head = 0;
81
+ while (head < n && head < m && keysA[head] === keysB[head]) {
82
+ pairs2.push([head, head]);
83
+ head++;
84
+ }
85
+ let tail = 0;
86
+ while (tail < n - head && tail < m - head && keysA[n - 1 - tail] === keysB[m - 1 - tail]) tail++;
87
+ for (let k = tail; k > 0; k--) pairs2.push([n - k, m - k]);
88
+ return pairs2;
89
+ }
90
+ const width = m + 1, table = new Uint32Array((n + 1) * width);
91
+ for (let i = n - 1; i >= 0; i--) {
92
+ for (let j = m - 1; j >= 0; j--) {
93
+ table[i * width + j] = keysA[i] === keysB[j] ? table[(i + 1) * width + j + 1] + 1 : Math.max(table[(i + 1) * width + j], table[i * width + j + 1]);
94
+ }
95
+ }
96
+ const pairs = [];
97
+ for (let i = 0, j = 0; i < n && j < m; ) {
98
+ if (keysA[i] === keysB[j]) {
99
+ pairs.push([i, j]);
100
+ i++;
101
+ j++;
102
+ } else if (table[(i + 1) * width + j] >= table[i * width + j + 1]) i++;
103
+ else j++;
104
+ }
105
+ return pairs;
106
+ }
107
+ function matchArrays(a, b, options = {}) {
108
+ const threshold = options.threshold ?? DEFAULT_MATCH_THRESHOLD;
109
+ const matchA = new Array(a.length).fill(-1), matchB = new Array(b.length).fill(-1);
110
+ const pairs = [];
111
+ const link = (i, j, by, score) => {
112
+ matchA[i] = j;
113
+ matchB[j] = i;
114
+ pairs.push(score === void 0 ? { a: i, b: j, by } : { a: i, b: j, by, similarity: score });
115
+ };
116
+ const free = (side) => side.map((value, index) => value < 0 ? index : -1).filter((index) => index >= 0);
117
+ const idsB = /* @__PURE__ */ new Map();
118
+ b.forEach((item, j) => {
119
+ const id = idOf(item);
120
+ if (id !== void 0) (idsB.get(id) ?? idsB.set(id, []).get(id)).push(j);
121
+ });
122
+ const used = /* @__PURE__ */ new Map();
123
+ a.forEach((item, i) => {
124
+ const id = idOf(item);
125
+ if (id === void 0) return;
126
+ const list = idsB.get(id), at = used.get(id) ?? 0;
127
+ if (list && at < list.length) {
128
+ link(i, list[at], "id");
129
+ used.set(id, at + 1);
130
+ }
131
+ });
132
+ let freeA = free(matchA), freeB = free(matchB);
133
+ const keysA = freeA.map((i) => canonical(a[i])), keysB = freeB.map((j) => canonical(b[j]));
134
+ for (const [x, y] of lcsPairs(keysA, keysB)) link(freeA[x], freeB[y], "equal");
135
+ freeA = free(matchA);
136
+ freeB = free(matchB);
137
+ const pool = /* @__PURE__ */ new Map();
138
+ freeB.forEach((j) => {
139
+ const key = canonical(b[j]);
140
+ (pool.get(key) ?? pool.set(key, []).get(key)).push(j);
141
+ });
142
+ for (const i of freeA) {
143
+ const list = pool.get(canonical(a[i]));
144
+ if (list?.length) link(i, list.shift(), "equal");
145
+ }
146
+ freeA = free(matchA).filter((i) => isComposite(a[i]));
147
+ freeB = free(matchB).filter((j) => isComposite(b[j]));
148
+ if (freeA.length && freeB.length && freeA.length * freeB.length <= MAX_SIMILARITY_PAIRS) {
149
+ const scored = [];
150
+ for (const i of freeA) for (const j of freeB) {
151
+ const idA = idOf(a[i]), idB = idOf(b[j]);
152
+ const needed = idA !== void 0 && idB !== void 0 && idA !== idB ? Math.max(threshold, DIFFERENT_ID_THRESHOLD) : threshold;
153
+ const score = similarity(a[i], b[j]);
154
+ if (score >= needed && score > 0) scored.push({ i, j, score });
155
+ }
156
+ scored.sort((x, y) => y.score - x.score || x.i - y.i || x.j - y.j);
157
+ for (const { i, j, score } of scored) if (matchA[i] < 0 && matchB[j] < 0) link(i, j, "similar", Math.round(score * 1e3) / 1e3);
158
+ }
159
+ pairs.sort((x, y) => x.a - y.a);
160
+ const chain = longestIncreasing(pairs.map((pair) => pair.b)).map((index) => pairs[index]);
161
+ const anchors = [[-1, -1], ...chain.map((pair) => [pair.a, pair.b]), [a.length, b.length]];
162
+ for (let k = 0; k + 1 < anchors.length; k++) {
163
+ const [a0, b0] = anchors[k], [a1, b1] = anchors[k + 1];
164
+ const gapA = [], gapB = [];
165
+ for (let i = a0 + 1; i < a1; i++) if (matchA[i] < 0 && !isComposite(a[i])) gapA.push(i);
166
+ for (let j = b0 + 1; j < b1; j++) if (matchB[j] < 0 && !isComposite(b[j])) gapB.push(j);
167
+ for (let n = 0; n < Math.min(gapA.length, gapB.length); n++) link(gapA[n], gapB[n], "position");
168
+ }
169
+ pairs.sort((x, y) => x.a - y.a);
170
+ const inChain = new Set(longestIncreasing(pairs.map((pair) => pair.b)));
171
+ const moved = /* @__PURE__ */ new Set();
172
+ pairs.forEach((pair, index) => {
173
+ if (!inChain.has(index)) moved.add(pair.a);
174
+ });
175
+ return { pairs, removed: free(matchA), added: free(matchB), moved };
176
+ }
177
+
178
+ // src/merge.ts
179
+ var ABSENT = /* @__PURE__ */ Symbol("absent");
180
+ var isObject2 = (value) => !!value && typeof value === "object" && !Array.isArray(value);
181
+ var has = (value, key) => Object.hasOwn(value, key);
182
+ var same = (x, y) => x === ABSENT || y === ABSENT ? x === y : jsonEqual(x, y);
183
+ var MESSAGES = {
184
+ "modify-modify": "Both sides changed this value differently.",
185
+ "modify-delete": "We changed this value; they deleted it.",
186
+ "delete-modify": "We deleted this value; they changed it.",
187
+ "add-add": "Both sides added different values here.",
188
+ "move-move": "Both sides moved this element to different positions."
189
+ };
190
+ function conflict(ctx, kind, path, base, ours, theirs) {
191
+ const entry = { kind, path: formatPointer(path), resolution: ctx.prefer, message: MESSAGES[kind] };
192
+ if (base !== ABSENT) entry.base = structuredClone(base);
193
+ if (ours !== ABSENT) entry.ours = structuredClone(ours);
194
+ if (theirs !== ABSENT) entry.theirs = structuredClone(theirs);
195
+ if (kind === "modify-delete") entry.deletedBy = "theirs";
196
+ if (kind === "delete-modify") entry.deletedBy = "ours";
197
+ if (ctx.slide) entry.slide = { ...ctx.slide };
198
+ ctx.conflicts.push(entry);
199
+ return ctx.prefer === "ours" ? ours : theirs;
200
+ }
201
+ function mergeValue(base, ours, theirs, path, ctx) {
202
+ if (same(ours, theirs)) {
203
+ if (!same(ours, base)) ctx.applied.both++;
204
+ return ours;
205
+ }
206
+ if (same(ours, base)) {
207
+ ctx.applied.theirs++;
208
+ return theirs;
209
+ }
210
+ if (same(theirs, base)) {
211
+ ctx.applied.ours++;
212
+ return ours;
213
+ }
214
+ if (base !== ABSENT) {
215
+ if (ours === ABSENT) return conflict(ctx, "delete-modify", path, base, ours, theirs);
216
+ if (theirs === ABSENT) return conflict(ctx, "modify-delete", path, base, ours, theirs);
217
+ if (isObject2(base) && isObject2(ours) && isObject2(theirs)) return mergeObject(base, ours, theirs, path, ctx);
218
+ if (Array.isArray(base) && Array.isArray(ours) && Array.isArray(theirs)) return mergeArray(base, ours, theirs, path, ctx);
219
+ return conflict(ctx, "modify-modify", path, base, ours, theirs);
220
+ }
221
+ if (isObject2(ours) && isObject2(theirs)) return mergeObject({}, ours, theirs, path, ctx);
222
+ if (Array.isArray(ours) && Array.isArray(theirs)) return mergeArray([], ours, theirs, path, ctx);
223
+ return conflict(ctx, "add-add", path, base, ours, theirs);
224
+ }
225
+ function mergeObject(base, ours, theirs, path, ctx) {
226
+ const keys = [];
227
+ const seen = /* @__PURE__ */ new Set();
228
+ for (const source of [base, ours, theirs]) for (const key of Object.keys(source)) if (!seen.has(key)) {
229
+ seen.add(key);
230
+ keys.push(key);
231
+ }
232
+ const out = {};
233
+ for (const key of keys) {
234
+ const value = mergeValue(has(base, key) ? base[key] : ABSENT, has(ours, key) ? ours[key] : ABSENT, has(theirs, key) ? theirs[key] : ABSENT, [...path, key], ctx);
235
+ if (value !== ABSENT) Object.defineProperty(out, key, { value, enumerable: true, configurable: true, writable: true });
236
+ }
237
+ return out;
238
+ }
239
+ function mergeArray(base, ours, theirs, path, ctx) {
240
+ const mo = matchArrays(base, ours, ctx.match), mt = matchArrays(base, theirs, ctx.match);
241
+ const oOf = new Array(base.length).fill(-1), tOf = new Array(base.length).fill(-1);
242
+ const baseOfO = new Array(ours.length).fill(-1), baseOfT = new Array(theirs.length).fill(-1);
243
+ for (const pair of mo.pairs) {
244
+ oOf[pair.a] = pair.b;
245
+ baseOfO[pair.b] = pair.a;
246
+ }
247
+ for (const pair of mt.pairs) {
248
+ tOf[pair.a] = pair.b;
249
+ baseOfT[pair.b] = pair.a;
250
+ }
251
+ const spine = ours.map((_, o) => {
252
+ const b = baseOfO[o];
253
+ return { b, o, t: b >= 0 ? tOf[b] : -1 };
254
+ });
255
+ const oursAddedOnly = (node) => !!node && node.b < 0 && node.o >= 0 && node.t < 0;
256
+ const tNode = /* @__PURE__ */ new Map();
257
+ for (const node of spine) if (node.t >= 0) tNode.set(node.t, node);
258
+ const insertAfterPredecessor = (ti, node) => {
259
+ let anchor;
260
+ for (let p = ti - 1; p >= 0 && !anchor; p--) anchor = tNode.get(p);
261
+ let at = anchor ? spine.indexOf(anchor) + 1 : 0;
262
+ while (oursAddedOnly(spine[at])) at++;
263
+ spine.splice(at, 0, node);
264
+ };
265
+ for (let ti = 0; ti < theirs.length; ti++) {
266
+ const bi = baseOfT[ti];
267
+ if (bi >= 0) {
268
+ if (oOf[bi] >= 0) continue;
269
+ if (same(base[bi], theirs[ti])) {
270
+ ctx.applied.ours++;
271
+ continue;
272
+ }
273
+ const node2 = { b: bi, o: -1, t: ti };
274
+ tNode.set(ti, node2);
275
+ insertAfterPredecessor(ti, node2);
276
+ continue;
277
+ }
278
+ const id = idOf(theirs[ti]);
279
+ let twin = id !== void 0 ? spine.find((node2) => oursAddedOnly(node2) && idOf(ours[node2.o]) === id) : void 0;
280
+ if (!twin) {
281
+ let anchor;
282
+ for (let p = ti - 1; p >= 0 && !anchor; p--) anchor = tNode.get(p);
283
+ for (let at = anchor ? spine.indexOf(anchor) + 1 : 0; oursAddedOnly(spine[at]); at++) {
284
+ if (jsonEqual(ours[spine[at].o], theirs[ti])) {
285
+ twin = spine[at];
286
+ break;
287
+ }
288
+ }
289
+ }
290
+ if (twin) {
291
+ twin.t = ti;
292
+ tNode.set(ti, twin);
293
+ continue;
294
+ }
295
+ const node = { b: -1, o: -1, t: ti };
296
+ tNode.set(ti, node);
297
+ insertAfterPredecessor(ti, node);
298
+ }
299
+ const basePredecessor = (list, index) => {
300
+ for (let p = index - 1; p >= 0; p--) if (list[p] >= 0) return list[p];
301
+ return -1;
302
+ };
303
+ const movedByTheirs = mt.pairs.filter((pair) => mt.moved.has(pair.a)).sort((x, y) => x.b - y.b);
304
+ for (const pair of movedByTheirs) {
305
+ const node = spine.find((candidate) => candidate.b === pair.a && candidate.o >= 0 && candidate.t === pair.b);
306
+ if (!node) continue;
307
+ if (mo.moved.has(pair.a)) {
308
+ if (basePredecessor(baseOfO, node.o) === basePredecessor(baseOfT, pair.b)) continue;
309
+ node.moveConflict = true;
310
+ if (ctx.prefer === "ours") continue;
311
+ }
312
+ spine.splice(spine.indexOf(node), 1);
313
+ insertAfterPredecessor(pair.b, node);
314
+ }
315
+ const out = [];
316
+ const isSlides = path.length === 1 && path[0] === "slides";
317
+ for (const node of spine) {
318
+ const at = [...path, out.length];
319
+ const savedSlide = ctx.slide;
320
+ if (isSlides) {
321
+ const sample = node.o >= 0 ? ours[node.o] : node.t >= 0 ? theirs[node.t] : base[node.b];
322
+ ctx.slide = { index: out.length, ...idOf(sample) !== void 0 ? { id: idOf(sample) } : {}, ...isObject2(sample) && (typeof sample.title === "string" || Array.isArray(sample.title)) && annotationText(sample.title) ? { title: annotationText(sample.title) } : {} };
323
+ }
324
+ try {
325
+ const b = node.b >= 0 ? base[node.b] : ABSENT, o = node.o >= 0 ? ours[node.o] : ABSENT, t = node.t >= 0 ? theirs[node.t] : ABSENT;
326
+ if (node.b >= 0) {
327
+ if (o !== ABSENT && t !== ABSENT) {
328
+ const merged = mergeValue(b, o, t, at, ctx);
329
+ if (node.moveConflict) {
330
+ ctx.conflicts.push({ kind: "move-move", path: formatPointer(at), base: structuredClone(b), resolution: ctx.prefer, message: MESSAGES["move-move"], ...ctx.slide ? { slide: { ...ctx.slide } } : {} });
331
+ }
332
+ out.push(merged);
333
+ } else if (o !== ABSENT) {
334
+ if (same(b, o)) ctx.applied.theirs++;
335
+ else {
336
+ const kept = conflict(ctx, "modify-delete", at, b, o, ABSENT);
337
+ if (kept !== ABSENT) out.push(kept);
338
+ }
339
+ } else if (t !== ABSENT) {
340
+ const kept = conflict(ctx, "delete-modify", at, b, ABSENT, t);
341
+ if (kept !== ABSENT) out.push(kept);
342
+ }
343
+ } else if (o !== ABSENT && t !== ABSENT) {
344
+ out.push(mergeValue(ABSENT, o, t, at, ctx));
345
+ } else if (o !== ABSENT) {
346
+ ctx.applied.ours++;
347
+ out.push(o);
348
+ } else {
349
+ ctx.applied.theirs++;
350
+ out.push(t);
351
+ }
352
+ } finally {
353
+ ctx.slide = savedSlide;
354
+ }
355
+ }
356
+ return out;
357
+ }
358
+ function merge(base, ours, theirs, options = {}) {
359
+ const ctx = {
360
+ prefer: options.prefer === "theirs" ? "theirs" : "ours",
361
+ match: { threshold: options.threshold ?? DEFAULT_MATCH_THRESHOLD },
362
+ conflicts: [],
363
+ applied: { ours: 0, theirs: 0, both: 0 }
364
+ };
365
+ const merged = mergeValue(structuredClone(base), structuredClone(ours), structuredClone(theirs), [], ctx);
366
+ return { merged: merged === ABSENT ? void 0 : merged, conflicts: ctx.conflicts, clean: ctx.conflicts.length === 0, applied: ctx.applied };
367
+ }
368
+
369
+ // src/diff.ts
370
+ var isObject3 = (value) => !!value && typeof value === "object" && !Array.isArray(value);
371
+ var REGION_KEY = /^(top|middle|bottom|left|center|right)([:+].*)?$/u;
372
+ var ROOT_CATEGORIES = { design: "design", assets: "assets", datasets: "datasets", catalogs: "catalogs", variables: "variables", narrative: "narrative", extensions: "extensions" };
373
+ function categoryOf(tokens) {
374
+ const [root] = tokens;
375
+ if (root === void 0) return "metadata";
376
+ if (root === "slides") {
377
+ if (tokens.length <= 2) return "slide";
378
+ if (tokens[2] === "design") return "design";
379
+ const last = tokens[tokens.length - 1] ?? "", parent = tokens[tokens.length - 2];
380
+ if (parent === "blocks" && /^\d+$/u.test(last)) return "block";
381
+ if (REGION_KEY.test(last)) return "block";
382
+ return "field";
383
+ }
384
+ return ROOT_CATEGORIES[root] ?? "metadata";
385
+ }
386
+ var pointer = (tokens) => formatPointer(tokens);
387
+ var titleOf = (slide) => isObject3(slide) ? annotationText(slide.title) || void 0 : void 0;
388
+ var slideRef = (slide, aIndex, bIndex) => {
389
+ const ref = {};
390
+ const id = idOf(slide), title = titleOf(slide);
391
+ if (id !== void 0) ref.id = id;
392
+ if (title !== void 0) ref.title = title;
393
+ if (aIndex !== void 0) ref.aIndex = aIndex;
394
+ if (bIndex !== void 0) ref.bIndex = bIndex;
395
+ return ref;
396
+ };
397
+ function record(ctx, change) {
398
+ if (ctx.slide) change.slide = { ...ctx.slide };
399
+ ctx.changes.push(change);
400
+ }
401
+ function diffValue(a, b, aPath, bPath, ctx) {
402
+ if (jsonEqual(a, b)) return;
403
+ if (Array.isArray(a) && Array.isArray(b)) {
404
+ diffArray(a, b, aPath, bPath, ctx);
405
+ return;
406
+ }
407
+ if (isObject3(a) && isObject3(b)) {
408
+ diffObject(a, b, aPath, bPath, ctx);
409
+ return;
410
+ }
411
+ ctx.patch.push({ op: "replace", path: pointer(bPath), value: structuredClone(b) });
412
+ record(ctx, { type: "changed", category: categoryOf(bPath.map(String)), aPath: pointer(aPath), bPath: pointer(bPath), before: structuredClone(a), after: structuredClone(b) });
413
+ }
414
+ function diffObject(a, b, aPath, bPath, ctx) {
415
+ const own = (value, key) => Object.hasOwn(value, key);
416
+ for (const key of Object.keys(a)) {
417
+ if (own(b, key)) continue;
418
+ ctx.patch.push({ op: "remove", path: pointer([...bPath, key]) });
419
+ record(ctx, { type: "removed", category: categoryOf([...aPath, key].map(String)), aPath: pointer([...aPath, key]), before: structuredClone(a[key]) });
420
+ }
421
+ for (const key of Object.keys(b)) {
422
+ if (!own(a, key)) {
423
+ ctx.patch.push({ op: "add", path: pointer([...bPath, key]), value: structuredClone(b[key]) });
424
+ record(ctx, { type: "added", category: categoryOf([...bPath, key].map(String)), bPath: pointer([...bPath, key]), after: structuredClone(b[key]) });
425
+ } else diffValue(a[key], b[key], [...aPath, key], [...bPath, key], ctx);
426
+ }
427
+ }
428
+ function diffArray(a, b, aPath, bPath, ctx) {
429
+ const match = matchArrays(a, b, ctx.options);
430
+ const isSlides = aPath.length === 1 && aPath[0] === "slides" && bPath.length === 1 && bPath[0] === "slides";
431
+ const category = (path) => categoryOf(path.map(String));
432
+ if (isSlides) {
433
+ const changedPairs = /* @__PURE__ */ new Set();
434
+ for (const pair of match.pairs) if (!jsonEqual(a[pair.a], b[pair.b])) changedPairs.add(pair.a);
435
+ const infos = [];
436
+ for (const pair of match.pairs) {
437
+ const moved = match.moved.has(pair.a), changed = changedPairs.has(pair.a);
438
+ infos.push({ ...slideRef(b[pair.b], pair.a, pair.b), matchedBy: pair.by, ...pair.similarity !== void 0 ? { similarity: pair.similarity } : {}, status: moved ? changed ? "moved-modified" : "moved" : changed ? "modified" : "unchanged" });
439
+ }
440
+ for (const i of match.removed) infos.push({ ...slideRef(a[i], i), status: "removed" });
441
+ for (const j of match.added) infos.push({ ...slideRef(b[j], void 0, j), status: "added" });
442
+ infos.sort((x, y) => (x.bIndex ?? Infinity) - (y.bIndex ?? Infinity) || (x.aIndex ?? 0) - (y.aIndex ?? 0));
443
+ ctx.slides.push(...infos);
444
+ }
445
+ const withSlide = (fn, aIndex, bIndex) => {
446
+ if (!isSlides) return fn();
447
+ const saved = ctx.slide;
448
+ ctx.slide = slideRef(bIndex !== void 0 ? b[bIndex] : a[aIndex], aIndex, bIndex);
449
+ try {
450
+ fn();
451
+ } finally {
452
+ ctx.slide = saved;
453
+ }
454
+ };
455
+ for (const i of [...match.removed].reverse()) ctx.patch.push({ op: "remove", path: pointer([...bPath, i]) });
456
+ for (const i of match.removed) withSlide(() => record(ctx, { type: "removed", category: category([...aPath, i]), aPath: pointer([...aPath, i]), before: structuredClone(a[i]) }), i, void 0);
457
+ const order = match.pairs.slice().sort((x, y) => x.b - y.b);
458
+ const current = match.pairs.map((pair) => pair.a);
459
+ order.forEach((pair, t) => {
460
+ if (!match.moved.has(pair.a)) return;
461
+ const from = current.indexOf(pair.a);
462
+ current.splice(from, 1);
463
+ const to = t === 0 ? 0 : current.indexOf(order[t - 1].a) + 1;
464
+ current.splice(to, 0, pair.a);
465
+ if (from !== to) ctx.patch.push({ op: "move", from: pointer([...bPath, from]), path: pointer([...bPath, to]) });
466
+ withSlide(() => record(ctx, { type: "moved", category: category([...bPath, pair.b]), aPath: pointer([...aPath, pair.a]), bPath: pointer([...bPath, pair.b]) }), pair.a, pair.b);
467
+ });
468
+ for (const j of match.added) {
469
+ ctx.patch.push({ op: "add", path: pointer([...bPath, j]), value: structuredClone(b[j]) });
470
+ withSlide(() => record(ctx, { type: "added", category: category([...bPath, j]), bPath: pointer([...bPath, j]), after: structuredClone(b[j]) }), void 0, j);
471
+ }
472
+ for (const pair of order) {
473
+ withSlide(() => diffValue(a[pair.a], b[pair.b], [...aPath, pair.a], [...bPath, pair.b], ctx), pair.a, pair.b);
474
+ }
475
+ }
476
+ function summarise(changes, slides) {
477
+ const summary = { total: changes.length, byCategory: {}, byType: {}, slides: { added: 0, removed: 0, moved: 0, modified: 0, unchanged: 0 } };
478
+ for (const change of changes) {
479
+ summary.byCategory[change.category] = (summary.byCategory[change.category] ?? 0) + 1;
480
+ summary.byType[change.type] = (summary.byType[change.type] ?? 0) + 1;
481
+ }
482
+ for (const slide of slides) {
483
+ if (slide.status === "added") summary.slides.added++;
484
+ else if (slide.status === "removed") summary.slides.removed++;
485
+ else if (slide.status === "unchanged") summary.slides.unchanged++;
486
+ else {
487
+ if (slide.status === "moved" || slide.status === "moved-modified") summary.slides.moved++;
488
+ if (slide.status === "modified" || slide.status === "moved-modified") summary.slides.modified++;
489
+ }
490
+ }
491
+ return summary;
492
+ }
493
+ function diff(a, b, options = {}) {
494
+ const ctx = { options: { threshold: options.threshold ?? DEFAULT_MATCH_THRESHOLD }, changes: [], patch: [], slides: [] };
495
+ diffValue(a, b, [], [], ctx);
496
+ return { equal: ctx.patch.length === 0, changes: ctx.changes, patch: ctx.patch, slides: ctx.slides, summary: summarise(ctx.changes, ctx.slides) };
497
+ }
498
+ var CONTENT_KINDS = ["blocks", "chart", "table", "code", "metric", "quote", "timeline", "image", "video", "items", "bullets", "text"];
499
+ function shorten(text, max = 60) {
500
+ const flat = text.replace(/\s+/gu, " ");
501
+ return flat.length > max ? `${flat.slice(0, max - 1)}\u2026` : flat;
502
+ }
503
+ function describeValue(value) {
504
+ if (value === void 0) return "";
505
+ if (typeof value === "string") return JSON.stringify(shorten(value));
506
+ if (value === null || typeof value !== "object") return String(value);
507
+ if (Array.isArray(value)) return `[${value.length} item${value.length === 1 ? "" : "s"}]`;
508
+ const keys = Object.keys(value);
509
+ const kind = CONTENT_KINDS.find((key) => key in value);
510
+ const record2 = value;
511
+ if (kind) {
512
+ const text = typeof record2.text === "string" ? ` ${JSON.stringify(shorten(record2.text, 40))}` : typeof record2.title === "string" ? ` ${JSON.stringify(shorten(record2.title, 40))}` : "";
513
+ return `${kind}${text}`;
514
+ }
515
+ if (typeof record2.id === "string") return `{id ${JSON.stringify(record2.id)}}`;
516
+ return `{${keys.slice(0, 3).join(", ")}${keys.length > 3 ? ", \u2026" : ""}}`;
517
+ }
518
+ function displayPath(pointerText, prefixLength = 0) {
519
+ if (pointerText === void 0) return "";
520
+ const tokens = pointerText.split("/").slice(1).map((token) => token.replaceAll("~1", "/").replaceAll("~0", "~")).slice(prefixLength);
521
+ if (!tokens.length) return "(whole value)";
522
+ return tokens.map((token, i) => /^\d+$/u.test(token) ? `[${token}]` : /^[A-Za-z_$][\w$-]*$/u.test(token) ? i ? `.${token}` : token : `[${JSON.stringify(token)}]`).join("");
523
+ }
524
+ function slideLabel(slide, side = "b") {
525
+ const index = side === "b" ? slide.bIndex ?? slide.aIndex : slide.aIndex ?? slide.bIndex;
526
+ const parts = [`#${(index ?? 0) + 1}`];
527
+ if (slide.title) parts.push(JSON.stringify(shorten(slide.title, 40)));
528
+ if (slide.id) parts.push(`(id ${slide.id})`);
529
+ return parts.join(" ");
530
+ }
531
+ function changeLine(change, prefixLength) {
532
+ switch (change.type) {
533
+ case "added":
534
+ return `+ ${displayPath(change.bPath, prefixLength)} ${describeValue(change.after)}`.trimEnd();
535
+ case "removed":
536
+ return `- ${displayPath(change.aPath, prefixLength)} ${describeValue(change.before)}`.trimEnd();
537
+ case "moved":
538
+ return `> ${displayPath(change.aPath, prefixLength)} -> ${displayPath(change.bPath, prefixLength)}`;
539
+ default:
540
+ return `~ ${displayPath(change.bPath, prefixLength)} ${describeValue(change.before)} -> ${describeValue(change.after)}`;
541
+ }
542
+ }
543
+ var SECTION_TITLES = {
544
+ metadata: "Metadata",
545
+ design: "Design",
546
+ variables: "Variables",
547
+ narrative: "Narrative",
548
+ assets: "Assets",
549
+ datasets: "Datasets",
550
+ catalogs: "Catalogs",
551
+ extensions: "Extensions",
552
+ slide: "Slides",
553
+ block: "Slides",
554
+ field: "Slides"
555
+ };
556
+ function formatDiffReport(diff2) {
557
+ if (diff2.equal) return "No differences.\n";
558
+ const lines = [];
559
+ const s = diff2.summary.slides;
560
+ const headline = [];
561
+ const slideParts = [[s.added, "added"], [s.removed, "removed"], [s.moved, "moved"], [s.modified, "modified"]].filter(([n]) => n > 0).map(([n, label]) => `${n} ${label}`);
562
+ if (slideParts.length) headline.push(`slides: ${slideParts.join(", ")}`);
563
+ for (const category of ["metadata", "design", "variables", "narrative", "assets", "datasets", "catalogs", "extensions"]) {
564
+ const count = diff2.summary.byCategory[category];
565
+ if (count) headline.push(`${category}: ${count}`);
566
+ }
567
+ lines.push(`${diff2.summary.total} change${diff2.summary.total === 1 ? "" : "s"} (${headline.join("; ")})`, "");
568
+ for (const category of ["metadata", "design", "variables", "narrative", "assets", "datasets", "catalogs", "extensions"]) {
569
+ const section = diff2.changes.filter((change) => change.category === category);
570
+ if (!section.length) continue;
571
+ lines.push(SECTION_TITLES[category]);
572
+ for (const change of section) lines.push(` ${changeLine(change, 0)}`);
573
+ lines.push("");
574
+ }
575
+ const slideChanges = diff2.changes.filter((change) => change.category === "slide" || change.category === "block" || change.category === "field" || change.slide && change.category === "design");
576
+ if (slideChanges.length || diff2.slides.some((slide) => slide.status !== "unchanged")) {
577
+ lines.push("Slides");
578
+ const whole = (change) => change.category === "slide" && !!change.slide && (change.bPath ?? change.aPath)?.split("/").length === 3;
579
+ for (const info of diff2.slides) {
580
+ if (info.status === "unchanged") continue;
581
+ if (info.status === "added") {
582
+ lines.push(` + slide ${slideLabel(info)}`);
583
+ continue;
584
+ }
585
+ if (info.status === "removed") {
586
+ lines.push(` - slide ${slideLabel(info, "a")}`);
587
+ continue;
588
+ }
589
+ const moveNote = info.status === "moved" || info.status === "moved-modified" ? ` (moved from #${(info.aIndex ?? 0) + 1})` : "";
590
+ lines.push(` ~ slide ${slideLabel(info)}${moveNote}${info.matchedBy === "similar" ? " (matched by content)" : ""}`);
591
+ const inner = slideChanges.filter((change) => !whole(change) && change.slide && change.slide.bIndex === info.bIndex && change.slide.aIndex === info.aIndex);
592
+ for (const change of inner) lines.push(` ${changeLine(change, 2)}`);
593
+ }
594
+ for (const change of slideChanges) if (!change.slide) lines.push(` ${changeLine(change, 0)}`);
595
+ lines.push("");
596
+ }
597
+ return `${lines.join("\n").replace(/\n+$/u, "")}
598
+ `;
599
+ }
600
+
601
+ export { categoryOf, describeValue, diff, formatDiffReport, matchArrays, merge, similarity };