react-cheminfo 0.28.0 → 0.29.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 (691) hide show
  1. package/README.md +38 -25
  2. package/lib/chart/core/axisLabels.d.ts +82 -0
  3. package/lib/chart/core/axisLabels.d.ts.map +1 -0
  4. package/lib/chart/core/axisLabels.js +111 -0
  5. package/lib/chart/core/axisLabels.js.map +1 -0
  6. package/lib/chart/core/boxLayout.d.ts +53 -0
  7. package/lib/chart/core/boxLayout.d.ts.map +1 -0
  8. package/lib/chart/core/boxLayout.js +112 -0
  9. package/lib/chart/core/boxLayout.js.map +1 -0
  10. package/lib/chart/core/chartAxisScale.d.ts +23 -2
  11. package/lib/chart/core/chartAxisScale.d.ts.map +1 -1
  12. package/lib/chart/core/chartAxisScale.js +64 -13
  13. package/lib/chart/core/chartAxisScale.js.map +1 -1
  14. package/lib/chart/core/chartDomain.d.ts +160 -0
  15. package/lib/chart/core/chartDomain.d.ts.map +1 -0
  16. package/lib/chart/core/chartDomain.js +46 -0
  17. package/lib/chart/core/chartDomain.js.map +1 -0
  18. package/lib/chart/core/chartGeometry.d.ts +131 -0
  19. package/lib/chart/core/chartGeometry.d.ts.map +1 -0
  20. package/lib/chart/core/chartGeometry.js +101 -0
  21. package/lib/chart/core/chartGeometry.js.map +1 -0
  22. package/lib/chart/core/chartPane.d.ts +11 -0
  23. package/lib/chart/core/chartPane.d.ts.map +1 -0
  24. package/lib/chart/core/chartPane.js +11 -0
  25. package/lib/chart/core/chartPane.js.map +1 -0
  26. package/lib/chart/core/chartScale.d.ts +4 -1
  27. package/lib/chart/core/chartScale.d.ts.map +1 -1
  28. package/lib/chart/core/chartScale.js +8 -4
  29. package/lib/chart/core/chartScale.js.map +1 -1
  30. package/lib/chart/core/chartTheme.d.ts +156 -0
  31. package/lib/chart/core/chartTheme.d.ts.map +1 -0
  32. package/lib/chart/core/chartTheme.js +156 -0
  33. package/lib/chart/core/chartTheme.js.map +1 -0
  34. package/lib/chart/core/chartViewport.d.ts +32 -5
  35. package/lib/chart/core/chartViewport.d.ts.map +1 -1
  36. package/lib/chart/core/chartViewport.js +40 -11
  37. package/lib/chart/core/chartViewport.js.map +1 -1
  38. package/lib/chart/core/guidePlacement.d.ts +52 -0
  39. package/lib/chart/core/guidePlacement.d.ts.map +1 -0
  40. package/lib/chart/core/guidePlacement.js +52 -0
  41. package/lib/chart/core/guidePlacement.js.map +1 -0
  42. package/lib/chart/core/index.d.ts +29 -2
  43. package/lib/chart/core/index.d.ts.map +1 -1
  44. package/lib/chart/core/index.js +19 -2
  45. package/lib/chart/core/index.js.map +1 -1
  46. package/lib/chart/core/labelStack.d.ts +27 -0
  47. package/lib/chart/core/labelStack.d.ts.map +1 -0
  48. package/lib/chart/core/labelStack.js +62 -0
  49. package/lib/chart/core/labelStack.js.map +1 -0
  50. package/lib/chart/core/legendBox.d.ts +152 -0
  51. package/lib/chart/core/legendBox.d.ts.map +1 -0
  52. package/lib/chart/core/legendBox.js +169 -0
  53. package/lib/chart/core/legendBox.js.map +1 -0
  54. package/lib/chart/core/selectionGeometry.d.ts +45 -0
  55. package/lib/chart/core/selectionGeometry.d.ts.map +1 -0
  56. package/lib/chart/core/selectionGeometry.js +49 -0
  57. package/lib/chart/core/selectionGeometry.js.map +1 -0
  58. package/lib/chart/core/spectrumColor.d.ts +80 -0
  59. package/lib/chart/core/spectrumColor.d.ts.map +1 -0
  60. package/lib/chart/core/spectrumColor.js +120 -0
  61. package/lib/chart/core/spectrumColor.js.map +1 -0
  62. package/lib/chart/core/stackCapacity.d.ts +136 -0
  63. package/lib/chart/core/stackCapacity.d.ts.map +1 -0
  64. package/lib/chart/core/stackCapacity.js +153 -0
  65. package/lib/chart/core/stackCapacity.js.map +1 -0
  66. package/lib/chart/core/svgPoint.d.ts +62 -0
  67. package/lib/chart/core/svgPoint.d.ts.map +1 -0
  68. package/lib/chart/core/svgPoint.js +43 -0
  69. package/lib/chart/core/svgPoint.js.map +1 -0
  70. package/lib/chart/core/tracePath.d.ts +94 -0
  71. package/lib/chart/core/tracePath.d.ts.map +1 -0
  72. package/lib/chart/core/tracePath.js +191 -0
  73. package/lib/chart/core/tracePath.js.map +1 -0
  74. package/lib/chart/core/trackerReadout.d.ts +55 -0
  75. package/lib/chart/core/trackerReadout.d.ts.map +1 -0
  76. package/lib/chart/core/trackerReadout.js +53 -0
  77. package/lib/chart/core/trackerReadout.js.map +1 -0
  78. package/lib/chart/core/viewTransform.d.ts +167 -0
  79. package/lib/chart/core/viewTransform.d.ts.map +1 -0
  80. package/lib/chart/core/viewTransform.js +188 -0
  81. package/lib/chart/core/viewTransform.js.map +1 -0
  82. package/lib/chart/core/zoomDomain.d.ts +127 -0
  83. package/lib/chart/core/zoomDomain.d.ts.map +1 -0
  84. package/lib/chart/core/zoomDomain.js +175 -0
  85. package/lib/chart/core/zoomDomain.js.map +1 -0
  86. package/lib/chart/ui/Axes.d.ts +104 -0
  87. package/lib/chart/ui/Axes.d.ts.map +1 -0
  88. package/lib/chart/ui/Axes.js +155 -0
  89. package/lib/chart/ui/Axes.js.map +1 -0
  90. package/lib/chart/ui/AxisGuide.d.ts +60 -0
  91. package/lib/chart/ui/AxisGuide.d.ts.map +1 -0
  92. package/lib/chart/ui/AxisGuide.js +111 -0
  93. package/lib/chart/ui/AxisGuide.js.map +1 -0
  94. package/lib/chart/ui/ChartStack.d.ts +81 -0
  95. package/lib/chart/ui/ChartStack.d.ts.map +1 -0
  96. package/lib/chart/ui/ChartStack.js +42 -0
  97. package/lib/chart/ui/ChartStack.js.map +1 -0
  98. package/lib/chart/ui/ChartTracker.d.ts +36 -0
  99. package/lib/chart/ui/ChartTracker.d.ts.map +1 -0
  100. package/lib/chart/ui/ChartTracker.js +27 -0
  101. package/lib/chart/ui/ChartTracker.js.map +1 -0
  102. package/lib/chart/ui/PlotCaption.d.ts +44 -0
  103. package/lib/chart/ui/PlotCaption.d.ts.map +1 -0
  104. package/lib/chart/ui/PlotCaption.js +68 -0
  105. package/lib/chart/ui/PlotCaption.js.map +1 -0
  106. package/lib/chart/ui/SelectionRect.d.ts +27 -0
  107. package/lib/chart/ui/SelectionRect.d.ts.map +1 -0
  108. package/lib/chart/ui/SelectionRect.js +31 -0
  109. package/lib/chart/ui/SelectionRect.js.map +1 -0
  110. package/lib/chart/ui/TraceLegend.d.ts +99 -0
  111. package/lib/chart/ui/TraceLegend.d.ts.map +1 -0
  112. package/lib/chart/ui/TraceLegend.js +45 -0
  113. package/lib/chart/ui/TraceLegend.js.map +1 -0
  114. package/lib/chart/ui/chartGestures.d.ts +158 -0
  115. package/lib/chart/ui/chartGestures.d.ts.map +1 -0
  116. package/lib/chart/ui/chartGestures.js +145 -0
  117. package/lib/chart/ui/chartGestures.js.map +1 -0
  118. package/lib/chart/ui/chartStackLevel.d.ts +115 -0
  119. package/lib/chart/ui/chartStackLevel.d.ts.map +1 -0
  120. package/lib/chart/ui/chartStackLevel.js +96 -0
  121. package/lib/chart/ui/chartStackLevel.js.map +1 -0
  122. package/lib/chart/ui/chartSurface.d.ts +35 -0
  123. package/lib/chart/ui/chartSurface.d.ts.map +1 -0
  124. package/lib/chart/ui/chartSurface.js +58 -0
  125. package/lib/chart/ui/chartSurface.js.map +1 -0
  126. package/lib/chart/ui/index.d.ts +24 -0
  127. package/lib/chart/ui/index.d.ts.map +1 -1
  128. package/lib/chart/ui/index.js +13 -0
  129. package/lib/chart/ui/index.js.map +1 -1
  130. package/lib/chart/ui/useChartPointer.d.ts +124 -0
  131. package/lib/chart/ui/useChartPointer.d.ts.map +1 -0
  132. package/lib/chart/ui/useChartPointer.js +152 -0
  133. package/lib/chart/ui/useChartPointer.js.map +1 -0
  134. package/lib/chart/ui/useChartSize.d.ts +49 -0
  135. package/lib/chart/ui/useChartSize.d.ts.map +1 -0
  136. package/lib/chart/ui/useChartSize.js +91 -0
  137. package/lib/chart/ui/useChartSize.js.map +1 -0
  138. package/lib/chart/ui/useChartWindow.d.ts +147 -0
  139. package/lib/chart/ui/useChartWindow.d.ts.map +1 -0
  140. package/lib/chart/ui/useChartWindow.js +135 -0
  141. package/lib/chart/ui/useChartWindow.js.map +1 -0
  142. package/lib/chart/ui/useChartZoom.d.ts +88 -0
  143. package/lib/chart/ui/useChartZoom.d.ts.map +1 -0
  144. package/lib/chart/ui/useChartZoom.js +142 -0
  145. package/lib/chart/ui/useChartZoom.js.map +1 -0
  146. package/lib/chart/ui/useWheelListener.d.ts +30 -0
  147. package/lib/chart/ui/useWheelListener.d.ts.map +1 -0
  148. package/lib/chart/ui/useWheelListener.js +57 -0
  149. package/lib/chart/ui/useWheelListener.js.map +1 -0
  150. package/lib/clipboard/core/copyPng.d.ts +13 -0
  151. package/lib/clipboard/core/copyPng.d.ts.map +1 -0
  152. package/lib/clipboard/core/copyPng.js +19 -0
  153. package/lib/clipboard/core/copyPng.js.map +1 -0
  154. package/lib/clipboard/core/index.d.ts +1 -0
  155. package/lib/clipboard/core/index.d.ts.map +1 -1
  156. package/lib/clipboard/core/index.js +1 -0
  157. package/lib/clipboard/core/index.js.map +1 -1
  158. package/lib/core.d.ts +1 -0
  159. package/lib/core.d.ts.map +1 -1
  160. package/lib/core.js +1 -0
  161. package/lib/core.js.map +1 -1
  162. package/lib/download/core/exportStyles.d.ts +22 -0
  163. package/lib/download/core/exportStyles.d.ts.map +1 -0
  164. package/lib/download/core/exportStyles.js +19 -0
  165. package/lib/download/core/exportStyles.js.map +1 -0
  166. package/lib/download/core/imageResolution.d.ts +88 -0
  167. package/lib/download/core/imageResolution.d.ts.map +1 -0
  168. package/lib/download/core/imageResolution.js +77 -0
  169. package/lib/download/core/imageResolution.js.map +1 -0
  170. package/lib/download/core/index.d.ts +13 -0
  171. package/lib/download/core/index.d.ts.map +1 -1
  172. package/lib/download/core/index.js +8 -0
  173. package/lib/download/core/index.js.map +1 -1
  174. package/lib/download/core/pictureExport.d.ts +93 -0
  175. package/lib/download/core/pictureExport.d.ts.map +1 -0
  176. package/lib/download/core/pictureExport.js +116 -0
  177. package/lib/download/core/pictureExport.js.map +1 -0
  178. package/lib/download/core/stackedDrawing.d.ts +36 -0
  179. package/lib/download/core/stackedDrawing.d.ts.map +1 -0
  180. package/lib/download/core/stackedDrawing.js +98 -0
  181. package/lib/download/core/stackedDrawing.js.map +1 -0
  182. package/lib/download/core/svgBounds.d.ts +44 -0
  183. package/lib/download/core/svgBounds.d.ts.map +1 -0
  184. package/lib/download/core/svgBounds.js +69 -0
  185. package/lib/download/core/svgBounds.js.map +1 -0
  186. package/lib/download/core/svgNamespace.d.ts +9 -0
  187. package/lib/download/core/svgNamespace.d.ts.map +1 -0
  188. package/lib/download/core/svgNamespace.js +10 -0
  189. package/lib/download/core/svgNamespace.js.map +1 -0
  190. package/lib/download/core/svgToPng.d.ts +43 -0
  191. package/lib/download/core/svgToPng.d.ts.map +1 -0
  192. package/lib/download/core/svgToPng.js +79 -0
  193. package/lib/download/core/svgToPng.js.map +1 -0
  194. package/lib/download/core/svgToString.d.ts +45 -0
  195. package/lib/download/core/svgToString.d.ts.map +1 -0
  196. package/lib/download/core/svgToString.js +58 -0
  197. package/lib/download/core/svgToString.js.map +1 -0
  198. package/lib/download/ui/ExportDialogFrame.d.ts +46 -0
  199. package/lib/download/ui/ExportDialogFrame.d.ts.map +1 -0
  200. package/lib/download/ui/ExportDialogFrame.js +24 -0
  201. package/lib/download/ui/ExportDialogFrame.js.map +1 -0
  202. package/lib/download/ui/ExportImageDialog.d.ts +47 -0
  203. package/lib/download/ui/ExportImageDialog.d.ts.map +1 -0
  204. package/lib/download/ui/ExportImageDialog.js +25 -0
  205. package/lib/download/ui/ExportImageDialog.js.map +1 -0
  206. package/lib/download/ui/ExportNameField.d.ts +29 -0
  207. package/lib/download/ui/ExportNameField.d.ts.map +1 -0
  208. package/lib/download/ui/ExportNameField.js +99 -0
  209. package/lib/download/ui/ExportNameField.js.map +1 -0
  210. package/lib/download/ui/ExportPictureSection.d.ts +38 -0
  211. package/lib/download/ui/ExportPictureSection.d.ts.map +1 -0
  212. package/lib/download/ui/ExportPictureSection.js +48 -0
  213. package/lib/download/ui/ExportPictureSection.js.map +1 -0
  214. package/lib/download/ui/index.d.ts +10 -0
  215. package/lib/download/ui/index.d.ts.map +1 -1
  216. package/lib/download/ui/index.js +5 -0
  217. package/lib/download/ui/index.js.map +1 -1
  218. package/lib/download/ui/useDrawingBox.d.ts +23 -0
  219. package/lib/download/ui/useDrawingBox.d.ts.map +1 -0
  220. package/lib/download/ui/useDrawingBox.js +21 -0
  221. package/lib/download/ui/useDrawingBox.js.map +1 -0
  222. package/lib/error/core/describeSource.d.ts +17 -0
  223. package/lib/error/core/describeSource.d.ts.map +1 -0
  224. package/lib/error/core/describeSource.js +19 -0
  225. package/lib/error/core/describeSource.js.map +1 -0
  226. package/lib/error/core/index.d.ts +1 -0
  227. package/lib/error/core/index.d.ts.map +1 -1
  228. package/lib/error/core/index.js +1 -0
  229. package/lib/error/core/index.js.map +1 -1
  230. package/lib/help/ui/HelpBody.d.ts +10 -1
  231. package/lib/help/ui/HelpBody.d.ts.map +1 -1
  232. package/lib/help/ui/HelpBody.js +24 -1
  233. package/lib/help/ui/HelpBody.js.map +1 -1
  234. package/lib/help/ui/index.d.ts +1 -1
  235. package/lib/help/ui/index.d.ts.map +1 -1
  236. package/lib/help/ui/index.js.map +1 -1
  237. package/lib/ir/core/analysisSpectra.d.ts +46 -0
  238. package/lib/ir/core/analysisSpectra.d.ts.map +1 -0
  239. package/lib/ir/core/analysisSpectra.js +187 -0
  240. package/lib/ir/core/analysisSpectra.js.map +1 -0
  241. package/lib/ir/core/assignBands.d.ts +83 -0
  242. package/lib/ir/core/assignBands.d.ts.map +1 -0
  243. package/lib/ir/core/assignBands.js +83 -0
  244. package/lib/ir/core/assignBands.js.map +1 -0
  245. package/lib/ir/core/bandAssignments.d.ts +47 -0
  246. package/lib/ir/core/bandAssignments.d.ts.map +1 -0
  247. package/lib/ir/core/bandAssignments.js +305 -0
  248. package/lib/ir/core/bandAssignments.js.map +1 -0
  249. package/lib/ir/core/bandLabelPlan.d.ts +93 -0
  250. package/lib/ir/core/bandLabelPlan.d.ts.map +1 -0
  251. package/lib/ir/core/bandLabelPlan.js +104 -0
  252. package/lib/ir/core/bandLabelPlan.js.map +1 -0
  253. package/lib/ir/core/detectIrFormat.d.ts +23 -0
  254. package/lib/ir/core/detectIrFormat.d.ts.map +1 -0
  255. package/lib/ir/core/detectIrFormat.js +133 -0
  256. package/lib/ir/core/detectIrFormat.js.map +1 -0
  257. package/lib/ir/core/downloadSpectra.d.ts +26 -0
  258. package/lib/ir/core/downloadSpectra.d.ts.map +1 -0
  259. package/lib/ir/core/downloadSpectra.js +37 -0
  260. package/lib/ir/core/downloadSpectra.js.map +1 -0
  261. package/lib/ir/core/fromJcamp.d.ts +35 -0
  262. package/lib/ir/core/fromJcamp.d.ts.map +1 -0
  263. package/lib/ir/core/fromJcamp.js +48 -0
  264. package/lib/ir/core/fromJcamp.js.map +1 -0
  265. package/lib/ir/core/fromSpc.d.ts +30 -0
  266. package/lib/ir/core/fromSpc.d.ts.map +1 -0
  267. package/lib/ir/core/fromSpc.js +40 -0
  268. package/lib/ir/core/fromSpc.js.map +1 -0
  269. package/lib/ir/core/index.d.ts +51 -0
  270. package/lib/ir/core/index.d.ts.map +1 -0
  271. package/lib/ir/core/index.js +35 -0
  272. package/lib/ir/core/index.js.map +1 -0
  273. package/lib/ir/core/irBand.d.ts +45 -0
  274. package/lib/ir/core/irBand.d.ts.map +1 -0
  275. package/lib/ir/core/irBand.js +30 -0
  276. package/lib/ir/core/irBand.js.map +1 -0
  277. package/lib/ir/core/irCommands.d.ts +168 -0
  278. package/lib/ir/core/irCommands.d.ts.map +1 -0
  279. package/lib/ir/core/irCommands.js +94 -0
  280. package/lib/ir/core/irCommands.js.map +1 -0
  281. package/lib/ir/core/irDomain.d.ts +63 -0
  282. package/lib/ir/core/irDomain.d.ts.map +1 -0
  283. package/lib/ir/core/irDomain.js +136 -0
  284. package/lib/ir/core/irDomain.js.map +1 -0
  285. package/lib/ir/core/irEditorApi.d.ts +42 -0
  286. package/lib/ir/core/irEditorApi.d.ts.map +1 -0
  287. package/lib/ir/core/irEditorApi.js +10 -0
  288. package/lib/ir/core/irEditorApi.js.map +1 -0
  289. package/lib/ir/core/irFormat.d.ts +42 -0
  290. package/lib/ir/core/irFormat.d.ts.map +1 -0
  291. package/lib/ir/core/irFormat.js +51 -0
  292. package/lib/ir/core/irFormat.js.map +1 -0
  293. package/lib/ir/core/irMode.d.ts +160 -0
  294. package/lib/ir/core/irMode.d.ts.map +1 -0
  295. package/lib/ir/core/irMode.js +175 -0
  296. package/lib/ir/core/irMode.js.map +1 -0
  297. package/lib/ir/core/irReducer.d.ts +101 -0
  298. package/lib/ir/core/irReducer.d.ts.map +1 -0
  299. package/lib/ir/core/irReducer.js +207 -0
  300. package/lib/ir/core/irReducer.js.map +1 -0
  301. package/lib/ir/core/irSidePanels.d.ts +22 -0
  302. package/lib/ir/core/irSidePanels.d.ts.map +1 -0
  303. package/lib/ir/core/irSidePanels.js +12 -0
  304. package/lib/ir/core/irSidePanels.js.map +1 -0
  305. package/lib/ir/core/irSpectrum.d.ts +140 -0
  306. package/lib/ir/core/irSpectrum.d.ts.map +1 -0
  307. package/lib/ir/core/irSpectrum.js +34 -0
  308. package/lib/ir/core/irSpectrum.js.map +1 -0
  309. package/lib/ir/core/irState.d.ts +119 -0
  310. package/lib/ir/core/irState.d.ts.map +1 -0
  311. package/lib/ir/core/irState.js +92 -0
  312. package/lib/ir/core/irState.js.map +1 -0
  313. package/lib/ir/core/loadIrSpectra.d.ts +36 -0
  314. package/lib/ir/core/loadIrSpectra.d.ts.map +1 -0
  315. package/lib/ir/core/loadIrSpectra.js +44 -0
  316. package/lib/ir/core/loadIrSpectra.js.map +1 -0
  317. package/lib/ir/core/nearestBand.d.ts +35 -0
  318. package/lib/ir/core/nearestBand.d.ts.map +1 -0
  319. package/lib/ir/core/nearestBand.js +47 -0
  320. package/lib/ir/core/nearestBand.js.map +1 -0
  321. package/lib/ir/core/pickBands.d.ts +70 -0
  322. package/lib/ir/core/pickBands.d.ts.map +1 -0
  323. package/lib/ir/core/pickBands.js +125 -0
  324. package/lib/ir/core/pickBands.js.map +1 -0
  325. package/lib/ir/core/spectrumJcamp.d.ts +58 -0
  326. package/lib/ir/core/spectrumJcamp.d.ts.map +1 -0
  327. package/lib/ir/core/spectrumJcamp.js +156 -0
  328. package/lib/ir/core/spectrumJcamp.js.map +1 -0
  329. package/lib/ir/core/toIrSpectrum.d.ts +59 -0
  330. package/lib/ir/core/toIrSpectrum.d.ts.map +1 -0
  331. package/lib/ir/core/toIrSpectrum.js +56 -0
  332. package/lib/ir/core/toIrSpectrum.js.map +1 -0
  333. package/lib/ir/ui/BandMarks.d.ts +52 -0
  334. package/lib/ir/ui/BandMarks.d.ts.map +1 -0
  335. package/lib/ir/ui/BandMarks.js +71 -0
  336. package/lib/ir/ui/BandMarks.js.map +1 -0
  337. package/lib/ir/ui/BandsPanel.d.ts +31 -0
  338. package/lib/ir/ui/BandsPanel.d.ts.map +1 -0
  339. package/lib/ir/ui/BandsPanel.js +94 -0
  340. package/lib/ir/ui/BandsPanel.js.map +1 -0
  341. package/lib/ir/ui/IrAboutDialog.d.ts +18 -0
  342. package/lib/ir/ui/IrAboutDialog.d.ts.map +1 -0
  343. package/lib/ir/ui/IrAboutDialog.js +32 -0
  344. package/lib/ir/ui/IrAboutDialog.js.map +1 -0
  345. package/lib/ir/ui/IrCanvas.d.ts +38 -0
  346. package/lib/ir/ui/IrCanvas.d.ts.map +1 -0
  347. package/lib/ir/ui/IrCanvas.js +41 -0
  348. package/lib/ir/ui/IrCanvas.js.map +1 -0
  349. package/lib/ir/ui/IrChart.d.ts +28 -0
  350. package/lib/ir/ui/IrChart.d.ts.map +1 -0
  351. package/lib/ir/ui/IrChart.js +114 -0
  352. package/lib/ir/ui/IrChart.js.map +1 -0
  353. package/lib/ir/ui/IrCommandProvider.d.ts +15 -0
  354. package/lib/ir/ui/IrCommandProvider.d.ts.map +1 -0
  355. package/lib/ir/ui/IrCommandProvider.js +14 -0
  356. package/lib/ir/ui/IrCommandProvider.js.map +1 -0
  357. package/lib/ir/ui/IrCommandTooltip.d.ts +16 -0
  358. package/lib/ir/ui/IrCommandTooltip.d.ts.map +1 -0
  359. package/lib/ir/ui/IrCommandTooltip.js +22 -0
  360. package/lib/ir/ui/IrCommandTooltip.js.map +1 -0
  361. package/lib/ir/ui/IrDocumentationDialog.d.ts +18 -0
  362. package/lib/ir/ui/IrDocumentationDialog.d.ts.map +1 -0
  363. package/lib/ir/ui/IrDocumentationDialog.js +68 -0
  364. package/lib/ir/ui/IrDocumentationDialog.js.map +1 -0
  365. package/lib/ir/ui/IrEditor.d.ts +60 -0
  366. package/lib/ir/ui/IrEditor.d.ts.map +1 -0
  367. package/lib/ir/ui/IrEditor.js +42 -0
  368. package/lib/ir/ui/IrEditor.js.map +1 -0
  369. package/lib/ir/ui/IrHeader.d.ts +13 -0
  370. package/lib/ir/ui/IrHeader.d.ts.map +1 -0
  371. package/lib/ir/ui/IrHeader.js +21 -0
  372. package/lib/ir/ui/IrHeader.js.map +1 -0
  373. package/lib/ir/ui/IrLogo.d.ts +20 -0
  374. package/lib/ir/ui/IrLogo.d.ts.map +1 -0
  375. package/lib/ir/ui/IrLogo.js +17 -0
  376. package/lib/ir/ui/IrLogo.js.map +1 -0
  377. package/lib/ir/ui/IrPointerTracker.d.ts +29 -0
  378. package/lib/ir/ui/IrPointerTracker.d.ts.map +1 -0
  379. package/lib/ir/ui/IrPointerTracker.js +47 -0
  380. package/lib/ir/ui/IrPointerTracker.js.map +1 -0
  381. package/lib/ir/ui/IrShell.d.ts +25 -0
  382. package/lib/ir/ui/IrShell.d.ts.map +1 -0
  383. package/lib/ir/ui/IrShell.js +178 -0
  384. package/lib/ir/ui/IrShell.js.map +1 -0
  385. package/lib/ir/ui/IrSidePanel.d.ts +26 -0
  386. package/lib/ir/ui/IrSidePanel.d.ts.map +1 -0
  387. package/lib/ir/ui/IrSidePanel.js +39 -0
  388. package/lib/ir/ui/IrSidePanel.js.map +1 -0
  389. package/lib/ir/ui/IrStateProvider.d.ts +19 -0
  390. package/lib/ir/ui/IrStateProvider.d.ts.map +1 -0
  391. package/lib/ir/ui/IrStateProvider.js +16 -0
  392. package/lib/ir/ui/IrStateProvider.js.map +1 -0
  393. package/lib/ir/ui/IrStatusBar.d.ts +14 -0
  394. package/lib/ir/ui/IrStatusBar.d.ts.map +1 -0
  395. package/lib/ir/ui/IrStatusBar.js +48 -0
  396. package/lib/ir/ui/IrStatusBar.js.map +1 -0
  397. package/lib/ir/ui/IrToolbar.d.ts +18 -0
  398. package/lib/ir/ui/IrToolbar.d.ts.map +1 -0
  399. package/lib/ir/ui/IrToolbar.js +32 -0
  400. package/lib/ir/ui/IrToolbar.js.map +1 -0
  401. package/lib/ir/ui/IrTraces.d.ts +63 -0
  402. package/lib/ir/ui/IrTraces.d.ts.map +1 -0
  403. package/lib/ir/ui/IrTraces.js +72 -0
  404. package/lib/ir/ui/IrTraces.js.map +1 -0
  405. package/lib/ir/ui/MetadataPanel.d.ts +15 -0
  406. package/lib/ir/ui/MetadataPanel.d.ts.map +1 -0
  407. package/lib/ir/ui/MetadataPanel.js +49 -0
  408. package/lib/ir/ui/MetadataPanel.js.map +1 -0
  409. package/lib/ir/ui/SpectraPanel.d.ts +20 -0
  410. package/lib/ir/ui/SpectraPanel.d.ts.map +1 -0
  411. package/lib/ir/ui/SpectraPanel.js +42 -0
  412. package/lib/ir/ui/SpectraPanel.js.map +1 -0
  413. package/lib/ir/ui/SpectrumRow.d.ts +26 -0
  414. package/lib/ir/ui/SpectrumRow.d.ts.map +1 -0
  415. package/lib/ir/ui/SpectrumRow.js +41 -0
  416. package/lib/ir/ui/SpectrumRow.js.map +1 -0
  417. package/lib/ir/ui/index.d.ts +56 -0
  418. package/lib/ir/ui/index.d.ts.map +1 -0
  419. package/lib/ir/ui/index.js +36 -0
  420. package/lib/ir/ui/index.js.map +1 -0
  421. package/lib/ir/ui/irActions.d.ts +52 -0
  422. package/lib/ir/ui/irActions.d.ts.map +1 -0
  423. package/lib/ir/ui/irActions.js +62 -0
  424. package/lib/ir/ui/irActions.js.map +1 -0
  425. package/lib/ir/ui/irChartProps.d.ts +116 -0
  426. package/lib/ir/ui/irChartProps.d.ts.map +1 -0
  427. package/lib/ir/ui/irChartProps.js +14 -0
  428. package/lib/ir/ui/irChartProps.js.map +1 -0
  429. package/lib/ir/ui/irCommandContext.d.ts +35 -0
  430. package/lib/ir/ui/irCommandContext.d.ts.map +1 -0
  431. package/lib/ir/ui/irCommandContext.js +44 -0
  432. package/lib/ir/ui/irCommandContext.js.map +1 -0
  433. package/lib/ir/ui/irStateContext.d.ts +26 -0
  434. package/lib/ir/ui/irStateContext.d.ts.map +1 -0
  435. package/lib/ir/ui/irStateContext.js +37 -0
  436. package/lib/ir/ui/irStateContext.js.map +1 -0
  437. package/lib/ir/ui/useIrEditor.d.ts +51 -0
  438. package/lib/ir/ui/useIrEditor.d.ts.map +1 -0
  439. package/lib/ir/ui/useIrEditor.js +88 -0
  440. package/lib/ir/ui/useIrEditor.js.map +1 -0
  441. package/lib/ir/ui/useIrPointer.d.ts +66 -0
  442. package/lib/ir/ui/useIrPointer.d.ts.map +1 -0
  443. package/lib/ir/ui/useIrPointer.js +53 -0
  444. package/lib/ir/ui/useIrPointer.js.map +1 -0
  445. package/lib/ir/ui/useIrShortcuts.d.ts +24 -0
  446. package/lib/ir/ui/useIrShortcuts.d.ts.map +1 -0
  447. package/lib/ir/ui/useIrShortcuts.js +73 -0
  448. package/lib/ir/ui/useIrShortcuts.js.map +1 -0
  449. package/lib/ir/ui/useIrZoom.d.ts +51 -0
  450. package/lib/ir/ui/useIrZoom.d.ts.map +1 -0
  451. package/lib/ir/ui/useIrZoom.js +46 -0
  452. package/lib/ir/ui/useIrZoom.js.map +1 -0
  453. package/lib/ir.d.ts +13 -0
  454. package/lib/ir.d.ts.map +1 -0
  455. package/lib/ir.js +13 -0
  456. package/lib/ir.js.map +1 -0
  457. package/lib/panel/core/dialogStyles.d.ts +13 -0
  458. package/lib/panel/core/dialogStyles.d.ts.map +1 -0
  459. package/lib/panel/core/dialogStyles.js +11 -0
  460. package/lib/panel/core/dialogStyles.js.map +1 -0
  461. package/lib/panel/core/index.d.ts +19 -0
  462. package/lib/panel/core/index.d.ts.map +1 -0
  463. package/lib/panel/core/index.js +18 -0
  464. package/lib/panel/core/index.js.map +1 -0
  465. package/lib/panel/core/isEditingField.d.ts +17 -0
  466. package/lib/panel/core/isEditingField.d.ts.map +1 -0
  467. package/lib/panel/core/isEditingField.js +25 -0
  468. package/lib/panel/core/isEditingField.js.map +1 -0
  469. package/lib/panel/core/panelStyles.d.ts +242 -0
  470. package/lib/panel/core/panelStyles.d.ts.map +1 -0
  471. package/lib/panel/core/panelStyles.js +228 -0
  472. package/lib/panel/core/panelStyles.js.map +1 -0
  473. package/lib/panel/core/rowSpacers.d.ts +38 -0
  474. package/lib/panel/core/rowSpacers.d.ts.map +1 -0
  475. package/lib/panel/core/rowSpacers.js +31 -0
  476. package/lib/panel/core/rowSpacers.js.map +1 -0
  477. package/lib/panel/core/statusBar.d.ts +44 -0
  478. package/lib/panel/core/statusBar.d.ts.map +1 -0
  479. package/lib/panel/core/statusBar.js +40 -0
  480. package/lib/panel/core/statusBar.js.map +1 -0
  481. package/lib/panel/core/textFilter.d.ts +22 -0
  482. package/lib/panel/core/textFilter.d.ts.map +1 -0
  483. package/lib/panel/core/textFilter.js +32 -0
  484. package/lib/panel/core/textFilter.js.map +1 -0
  485. package/lib/panel/core/yieldToPainting.d.ts +17 -0
  486. package/lib/panel/core/yieldToPainting.d.ts.map +1 -0
  487. package/lib/panel/core/yieldToPainting.js +21 -0
  488. package/lib/panel/core/yieldToPainting.js.map +1 -0
  489. package/lib/panel/ui/AboutDialogFrame.d.ts +36 -0
  490. package/lib/panel/ui/AboutDialogFrame.d.ts.map +1 -0
  491. package/lib/panel/ui/AboutDialogFrame.js +43 -0
  492. package/lib/panel/ui/AboutDialogFrame.js.map +1 -0
  493. package/lib/panel/ui/ClearButton.d.ts +28 -0
  494. package/lib/panel/ui/ClearButton.d.ts.map +1 -0
  495. package/lib/panel/ui/ClearButton.js +23 -0
  496. package/lib/panel/ui/ClearButton.js.map +1 -0
  497. package/lib/panel/ui/DocumentationDialogFrame.d.ts +39 -0
  498. package/lib/panel/ui/DocumentationDialogFrame.d.ts.map +1 -0
  499. package/lib/panel/ui/DocumentationDialogFrame.js +29 -0
  500. package/lib/panel/ui/DocumentationDialogFrame.js.map +1 -0
  501. package/lib/panel/ui/FilterInput.d.ts +31 -0
  502. package/lib/panel/ui/FilterInput.d.ts.map +1 -0
  503. package/lib/panel/ui/FilterInput.js +23 -0
  504. package/lib/panel/ui/FilterInput.js.map +1 -0
  505. package/lib/panel/ui/HelpLabel.d.ts +24 -0
  506. package/lib/panel/ui/HelpLabel.d.ts.map +1 -0
  507. package/lib/panel/ui/HelpLabel.js +23 -0
  508. package/lib/panel/ui/HelpLabel.js.map +1 -0
  509. package/lib/panel/ui/PanelMessage.d.ts +41 -0
  510. package/lib/panel/ui/PanelMessage.d.ts.map +1 -0
  511. package/lib/panel/ui/PanelMessage.js +30 -0
  512. package/lib/panel/ui/PanelMessage.js.map +1 -0
  513. package/lib/panel/ui/PanelRail.d.ts +41 -0
  514. package/lib/panel/ui/PanelRail.d.ts.map +1 -0
  515. package/lib/panel/ui/PanelRail.js +12 -0
  516. package/lib/panel/ui/PanelRail.js.map +1 -0
  517. package/lib/panel/ui/Section.d.ts +25 -0
  518. package/lib/panel/ui/Section.d.ts.map +1 -0
  519. package/lib/panel/ui/Section.js +41 -0
  520. package/lib/panel/ui/Section.js.map +1 -0
  521. package/lib/panel/ui/SidePanelStack.d.ts +62 -0
  522. package/lib/panel/ui/SidePanelStack.d.ts.map +1 -0
  523. package/lib/panel/ui/SidePanelStack.js +40 -0
  524. package/lib/panel/ui/SidePanelStack.js.map +1 -0
  525. package/lib/panel/ui/SpectrumColorSwatch.d.ts +33 -0
  526. package/lib/panel/ui/SpectrumColorSwatch.d.ts.map +1 -0
  527. package/lib/panel/ui/SpectrumColorSwatch.js +76 -0
  528. package/lib/panel/ui/SpectrumColorSwatch.js.map +1 -0
  529. package/lib/panel/ui/index.d.ts +37 -0
  530. package/lib/panel/ui/index.d.ts.map +1 -0
  531. package/lib/panel/ui/index.js +24 -0
  532. package/lib/panel/ui/index.js.map +1 -0
  533. package/lib/panel/ui/useConfirmOnEnter.d.ts +19 -0
  534. package/lib/panel/ui/useConfirmOnEnter.d.ts.map +1 -0
  535. package/lib/panel/ui/useConfirmOnEnter.js +64 -0
  536. package/lib/panel/ui/useConfirmOnEnter.js.map +1 -0
  537. package/lib/panel/ui/useFilterBox.d.ts +23 -0
  538. package/lib/panel/ui/useFilterBox.d.ts.map +1 -0
  539. package/lib/panel/ui/useFilterBox.js +22 -0
  540. package/lib/panel/ui/useFilterBox.js.map +1 -0
  541. package/lib/panel/ui/useVirtualRows.d.ts +46 -0
  542. package/lib/panel/ui/useVirtualRows.d.ts.map +1 -0
  543. package/lib/panel/ui/useVirtualRows.js +56 -0
  544. package/lib/panel/ui/useVirtualRows.js.map +1 -0
  545. package/lib/panel/ui/useVirtualWindowRows.d.ts +40 -0
  546. package/lib/panel/ui/useVirtualWindowRows.d.ts.map +1 -0
  547. package/lib/panel/ui/useVirtualWindowRows.js +65 -0
  548. package/lib/panel/ui/useVirtualWindowRows.js.map +1 -0
  549. package/lib/ui.d.ts +1 -0
  550. package/lib/ui.d.ts.map +1 -1
  551. package/lib/ui.js +1 -0
  552. package/lib/ui.js.map +1 -1
  553. package/package.json +8 -1
  554. package/src/chart/core/axisLabels.ts +117 -0
  555. package/src/chart/core/boxLayout.ts +126 -0
  556. package/src/chart/core/chartAxisScale.ts +92 -10
  557. package/src/chart/core/chartDomain.ts +185 -0
  558. package/src/chart/core/chartGeometry.ts +159 -0
  559. package/src/chart/core/chartPane.ts +10 -0
  560. package/src/chart/core/chartScale.ts +7 -4
  561. package/src/chart/core/chartTheme.ts +161 -0
  562. package/src/chart/core/chartViewport.ts +40 -13
  563. package/src/chart/core/guidePlacement.ts +66 -0
  564. package/src/chart/core/index.ts +121 -2
  565. package/src/chart/core/labelStack.ts +72 -0
  566. package/src/chart/core/legendBox.ts +263 -0
  567. package/src/chart/core/selectionGeometry.ts +68 -0
  568. package/src/chart/core/spectrumColor.ts +129 -0
  569. package/src/chart/core/stackCapacity.ts +162 -0
  570. package/src/chart/core/svgPoint.ts +77 -0
  571. package/src/chart/core/tracePath.ts +228 -0
  572. package/src/chart/core/trackerReadout.ts +78 -0
  573. package/src/chart/core/viewTransform.ts +287 -0
  574. package/src/chart/core/zoomDomain.ts +235 -0
  575. package/src/chart/ui/Axes.tsx +361 -0
  576. package/src/chart/ui/AxisGuide.tsx +187 -0
  577. package/src/chart/ui/ChartStack.tsx +130 -0
  578. package/src/chart/ui/ChartTracker.tsx +101 -0
  579. package/src/chart/ui/PlotCaption.tsx +108 -0
  580. package/src/chart/ui/SelectionRect.tsx +52 -0
  581. package/src/chart/ui/TraceLegend.tsx +193 -0
  582. package/src/chart/ui/chartGestures.ts +270 -0
  583. package/src/chart/ui/chartStackLevel.tsx +210 -0
  584. package/src/chart/ui/chartSurface.ts +66 -0
  585. package/src/chart/ui/index.ts +35 -0
  586. package/src/chart/ui/useChartPointer.ts +223 -0
  587. package/src/chart/ui/useChartSize.ts +115 -0
  588. package/src/chart/ui/useChartWindow.ts +240 -0
  589. package/src/chart/ui/useChartZoom.ts +255 -0
  590. package/src/chart/ui/useWheelListener.ts +62 -0
  591. package/src/clipboard/core/copyPng.ts +20 -0
  592. package/src/clipboard/core/index.ts +1 -0
  593. package/src/core.ts +1 -0
  594. package/src/download/core/exportStyles.ts +20 -0
  595. package/src/download/core/imageResolution.ts +118 -0
  596. package/src/download/core/index.ts +34 -0
  597. package/src/download/core/pictureExport.ts +207 -0
  598. package/src/download/core/stackedDrawing.ts +108 -0
  599. package/src/download/core/svgBounds.ts +80 -0
  600. package/src/download/core/svgNamespace.ts +9 -0
  601. package/src/download/core/svgToPng.ts +121 -0
  602. package/src/download/core/svgToString.ts +95 -0
  603. package/src/download/ui/ExportDialogFrame.tsx +86 -0
  604. package/src/download/ui/ExportImageDialog.tsx +91 -0
  605. package/src/download/ui/ExportNameField.tsx +148 -0
  606. package/src/download/ui/ExportPictureSection.tsx +142 -0
  607. package/src/download/ui/index.ts +11 -0
  608. package/src/download/ui/useDrawingBox.ts +37 -0
  609. package/src/error/core/describeSource.ts +18 -0
  610. package/src/error/core/index.ts +1 -0
  611. package/src/help/ui/HelpBody.tsx +41 -2
  612. package/src/help/ui/index.ts +6 -1
  613. package/src/ir/core/analysisSpectra.ts +231 -0
  614. package/src/ir/core/assignBands.ts +144 -0
  615. package/src/ir/core/bandAssignments.ts +329 -0
  616. package/src/ir/core/bandLabelPlan.ts +194 -0
  617. package/src/ir/core/detectIrFormat.ts +139 -0
  618. package/src/ir/core/downloadSpectra.ts +57 -0
  619. package/src/ir/core/fromJcamp.ts +70 -0
  620. package/src/ir/core/fromSpc.ts +61 -0
  621. package/src/ir/core/index.ts +113 -0
  622. package/src/ir/core/irBand.ts +57 -0
  623. package/src/ir/core/irCommands.ts +154 -0
  624. package/src/ir/core/irDomain.ts +163 -0
  625. package/src/ir/core/irEditorApi.ts +44 -0
  626. package/src/ir/core/irFormat.ts +57 -0
  627. package/src/ir/core/irMode.ts +203 -0
  628. package/src/ir/core/irReducer.ts +273 -0
  629. package/src/ir/core/irSidePanels.ts +20 -0
  630. package/src/ir/core/irSpectrum.ts +155 -0
  631. package/src/ir/core/irState.ts +173 -0
  632. package/src/ir/core/loadIrSpectra.ts +79 -0
  633. package/src/ir/core/nearestBand.ts +57 -0
  634. package/src/ir/core/pickBands.ts +181 -0
  635. package/src/ir/core/spectrumJcamp.ts +178 -0
  636. package/src/ir/core/toIrSpectrum.ts +102 -0
  637. package/src/ir/ui/BandMarks.tsx +166 -0
  638. package/src/ir/ui/BandsPanel.tsx +271 -0
  639. package/src/ir/ui/IrAboutDialog.tsx +121 -0
  640. package/src/ir/ui/IrCanvas.tsx +91 -0
  641. package/src/ir/ui/IrChart.tsx +215 -0
  642. package/src/ir/ui/IrCommandProvider.tsx +32 -0
  643. package/src/ir/ui/IrCommandTooltip.tsx +36 -0
  644. package/src/ir/ui/IrDocumentationDialog.tsx +174 -0
  645. package/src/ir/ui/IrEditor.tsx +99 -0
  646. package/src/ir/ui/IrHeader.tsx +39 -0
  647. package/src/ir/ui/IrLogo.tsx +49 -0
  648. package/src/ir/ui/IrPointerTracker.tsx +102 -0
  649. package/src/ir/ui/IrShell.tsx +285 -0
  650. package/src/ir/ui/IrSidePanel.tsx +78 -0
  651. package/src/ir/ui/IrStateProvider.tsx +32 -0
  652. package/src/ir/ui/IrStatusBar.tsx +97 -0
  653. package/src/ir/ui/IrToolbar.tsx +102 -0
  654. package/src/ir/ui/IrTraces.tsx +134 -0
  655. package/src/ir/ui/MetadataPanel.tsx +88 -0
  656. package/src/ir/ui/SpectraPanel.tsx +114 -0
  657. package/src/ir/ui/SpectrumRow.tsx +127 -0
  658. package/src/ir/ui/index.ts +56 -0
  659. package/src/ir/ui/irActions.ts +103 -0
  660. package/src/ir/ui/irChartProps.ts +118 -0
  661. package/src/ir/ui/irCommandContext.tsx +62 -0
  662. package/src/ir/ui/irStateContext.ts +48 -0
  663. package/src/ir/ui/useIrEditor.ts +139 -0
  664. package/src/ir/ui/useIrPointer.ts +109 -0
  665. package/src/ir/ui/useIrShortcuts.ts +95 -0
  666. package/src/ir/ui/useIrZoom.ts +86 -0
  667. package/src/ir.ts +13 -0
  668. package/src/panel/core/dialogStyles.ts +11 -0
  669. package/src/panel/core/index.ts +47 -0
  670. package/src/panel/core/isEditingField.ts +23 -0
  671. package/src/panel/core/panelStyles.ts +248 -0
  672. package/src/panel/core/rowSpacers.ts +50 -0
  673. package/src/panel/core/statusBar.ts +48 -0
  674. package/src/panel/core/textFilter.ts +33 -0
  675. package/src/panel/core/yieldToPainting.ts +20 -0
  676. package/src/panel/ui/AboutDialogFrame.tsx +100 -0
  677. package/src/panel/ui/ClearButton.tsx +42 -0
  678. package/src/panel/ui/DocumentationDialogFrame.tsx +86 -0
  679. package/src/panel/ui/FilterInput.tsx +60 -0
  680. package/src/panel/ui/HelpLabel.tsx +43 -0
  681. package/src/panel/ui/PanelMessage.tsx +64 -0
  682. package/src/panel/ui/PanelRail.tsx +64 -0
  683. package/src/panel/ui/Section.tsx +66 -0
  684. package/src/panel/ui/SidePanelStack.tsx +109 -0
  685. package/src/panel/ui/SpectrumColorSwatch.tsx +119 -0
  686. package/src/panel/ui/index.ts +47 -0
  687. package/src/panel/ui/useConfirmOnEnter.ts +68 -0
  688. package/src/panel/ui/useFilterBox.ts +35 -0
  689. package/src/panel/ui/useVirtualRows.ts +82 -0
  690. package/src/panel/ui/useVirtualWindowRows.ts +86 -0
  691. package/src/ui.ts +1 -0
@@ -0,0 +1,25 @@
1
+ import type { Ref } from 'react';
2
+ import type { IrEditorHandle } from '../core/irEditorApi.ts';
3
+ export interface IrShellProps {
4
+ /**
5
+ * The handle to fill in, once there is a state for it to act on.
6
+ * @default undefined
7
+ */
8
+ handle?: Ref<IrEditorHandle>;
9
+ }
10
+ /**
11
+ * The viewer's screen: a header, the rails, and the split between the chart and
12
+ * the panels.
13
+ *
14
+ * Kept apart from `IrEditor` so that the handle, the commands and the highlight —
15
+ * all of which need the state — sit below the providers rather than beside them,
16
+ * and so the sealed component above is nothing but its props.
17
+ *
18
+ * The panels run to the bottom edge while the status bar stops at the splitter,
19
+ * which is what says the bar belongs to the chart and the panels are their own
20
+ * column.
21
+ * @param props - Component props.
22
+ * @returns The screen.
23
+ */
24
+ export declare function IrShell(props: IrShellProps): import("react").JSX.Element;
25
+ //# sourceMappingURL=IrShell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IrShell.d.ts","sourceRoot":"","sources":["../../../src/ir/ui/IrShell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAWjC,OAAO,KAAK,EAAE,cAAc,EAAqB,MAAM,wBAAwB,CAAC;AAgBhF,MAAM,WAAW,YAAY;IAC3B;;;OAGG;IACH,MAAM,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC9B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,+BAuL1C"}
@@ -0,0 +1,178 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useCallback, useImperativeHandle, useMemo, useState } from 'react';
3
+ import { SplitPane, useFullscreen } from 'react-science/ui';
4
+ import { sanitizeFileName } from "../../download/core/sanitizeFileName.js";
5
+ import { ExportImageDialog } from "../../download/ui/ExportImageDialog.js";
6
+ import { useDrawingBox } from "../../download/ui/useDrawingBox.js";
7
+ import { PanelRail } from "../../panel/ui/PanelRail.js";
8
+ import { fullDomain } from "../core/irDomain.js";
9
+ import { otherIrMode, yAxisRules } from "../core/irMode.js";
10
+ import { irSidePanels } from "../core/irSidePanels.js";
11
+ import { DEFAULT_SIDE_PANEL } from "../core/irState.js";
12
+ import { IrAboutDialog } from "./IrAboutDialog.js";
13
+ import { IrCanvas } from "./IrCanvas.js";
14
+ import { IrCommandProvider } from "./IrCommandProvider.js";
15
+ import { IrDocumentationDialog } from "./IrDocumentationDialog.js";
16
+ import { IrHeader } from "./IrHeader.js";
17
+ import { IrSidePanel } from "./IrSidePanel.js";
18
+ import { IrToolbar } from "./IrToolbar.js";
19
+ import { useIrActions, useIrEditorState } from "./irStateContext.js";
20
+ import { useIrShortcuts } from "./useIrShortcuts.js";
21
+ /**
22
+ * The viewer's screen: a header, the rails, and the split between the chart and
23
+ * the panels.
24
+ *
25
+ * Kept apart from `IrEditor` so that the handle, the commands and the highlight —
26
+ * all of which need the state — sit below the providers rather than beside them,
27
+ * and so the sealed component above is nothing but its props.
28
+ *
29
+ * The panels run to the bottom edge while the status bar stops at the splitter,
30
+ * which is what says the bar belongs to the chart and the panels are their own
31
+ * column.
32
+ * @param props - Component props.
33
+ * @returns The screen.
34
+ */
35
+ export function IrShell(props) {
36
+ const { handle } = props;
37
+ const { state, visibleSpectra, selectedSpectrum } = useIrEditorState();
38
+ const actions = useIrActions();
39
+ const { toggle: toggleFullScreen } = useFullscreen();
40
+ const { openPanelIds, tool, domain } = state.view;
41
+ const { mode, pickBands, showAssignments } = state.settings;
42
+ const [isAboutOpen, setIsAboutOpen] = useState(false);
43
+ const [isDocumentationOpen, setIsDocumentationOpen] = useState(false);
44
+ const [isExportImageOpen, setIsExportImageOpen] = useState(false);
45
+ // The chart is the picture, so the box it is drawn in is what the export
46
+ // dialog is pointed at: the viewer around it is full of SVG — every icon in
47
+ // every toolbar is one — and the first found there would be a magnifier.
48
+ const chart = useDrawingBox();
49
+ // The highlight is held here rather than in the reducer: what the pointer is
50
+ // resting on is not part of the document and changes on every move across the
51
+ // chart, so putting it through the reducer would run every panel's memo sixty
52
+ // times a second.
53
+ const [highlight, setHighlight] = useState(null);
54
+ /**
55
+ * ChartScale the value axis by a factor, about the baseline the mode hangs from.
56
+ * @param factor - Above one to zoom out.
57
+ */
58
+ const scaleValueAxis = useCallback((factor) => {
59
+ const shown = domain ?? fullDomain(visibleSpectra, mode);
60
+ // Asked of the mode rather than written out again here: the baseline a
61
+ // value axis is scaled about is `irMode`'s to know, and a second copy of
62
+ // it is a second thing to get wrong.
63
+ const { baseline = 0 } = yAxisRules(mode);
64
+ actions.setDomain({
65
+ x: shown.x,
66
+ y: [
67
+ baseline + (shown.y[0] - baseline) * factor,
68
+ baseline + (shown.y[1] - baseline) * factor,
69
+ ],
70
+ });
71
+ }, [actions, domain, visibleSpectra, mode]);
72
+ const commands = useMemo(() => ({
73
+ about: () => setIsAboutOpen(true),
74
+ documentation: () => setIsDocumentationOpen(true),
75
+ fullScreen: toggleFullScreen,
76
+ readTool: () => actions.setTool('read'),
77
+ boxTool: () => actions.setTool(tool === 'box' ? 'read' : 'box'),
78
+ zoomIn: () => scaleValueAxis(1 / ZOOM_STEP),
79
+ zoomOut: () => scaleValueAxis(ZOOM_STEP),
80
+ resetZoom: () => actions.resetDomain(),
81
+ toggleMode: () => actions.setSettings({ mode: otherIrMode(mode) }),
82
+ togglePicking: () => actions.setSettings({ pickBands: !pickBands }),
83
+ toggleAssignments: () => actions.setSettings({ showAssignments: !showAssignments }),
84
+ exportImage: () => setIsExportImageOpen(true),
85
+ clear: () => actions.clear(),
86
+ }), [
87
+ actions,
88
+ tool,
89
+ mode,
90
+ pickBands,
91
+ showAssignments,
92
+ scaleValueAxis,
93
+ toggleFullScreen,
94
+ ]);
95
+ // The root is held as state rather than in a ref because the keys are bound to
96
+ // it from an effect: a ref filled in during the commit would leave the effect
97
+ // with nothing to listen on for the first render, and no reason ever to run
98
+ // again.
99
+ const [root, setRoot] = useState(null);
100
+ useIrShortcuts(root, commands);
101
+ useImperativeHandle(handle, () => ({
102
+ getSpectra: () => state.data.spectra,
103
+ setSpectra: (spectra) => actions.setSpectra(spectra),
104
+ addSpectra: (spectra) => actions.addSpectra(spectra),
105
+ clear: () => actions.clear(),
106
+ setDomain: (next) => actions.setDomain(next),
107
+ resetDomain: () => actions.resetDomain(),
108
+ zoomToWavenumber: (wavenumber, options = {}) => {
109
+ const { width = DEFAULT_FRAME_WIDTH } = options;
110
+ const shown = domain ?? fullDomain(visibleSpectra, mode);
111
+ actions.setDomain({
112
+ x: [wavenumber - width / 2, wavenumber + width / 2],
113
+ y: shown.y,
114
+ });
115
+ },
116
+ selectSpectrum: (id) => actions.selectSpectrum(id),
117
+ }), [state.data.spectra, actions, domain, visibleSpectra, mode]);
118
+ /**
119
+ * Open or close the side, as the splitter is dragged shut and back open.
120
+ * @param open - Whether the side is now open.
121
+ */
122
+ function setSideOpen(open) {
123
+ if (!open) {
124
+ for (const panelId of openPanelIds)
125
+ actions.togglePanel(panelId);
126
+ return;
127
+ }
128
+ // Dragging the splitter back open must land on something, or it opens on an
129
+ // empty column and reads as broken.
130
+ if (openPanelIds.length === 0)
131
+ actions.togglePanel(DEFAULT_SIDE_PANEL);
132
+ }
133
+ return (_jsxs(IrCommandProvider, { handlers: commands, children: [_jsxs("div", { ref: setRoot, tabIndex: -1, style: rootStyle, children: [_jsx(IrHeader, {}), _jsxs("div", { style: mainStyle, children: [_jsx("div", { style: railStyle, children: _jsx(IrToolbar, {}) }), _jsxs(SplitPane, { direction: "horizontal", controlledSide: "end", defaultSize: "360px", open: openPanelIds.length > 0, onOpenChange: setSideOpen, children: [_jsx(IrCanvas, { highlight: highlight, onHighlight: setHighlight, attachChart: chart.attach }), _jsx(IrSidePanel, { highlight: highlight, onHighlight: setHighlight })] }), _jsx("div", { style: railStyle, children: _jsx(PanelRail, { panels: irSidePanels, openIds: openPanelIds, onToggle: actions.togglePanel }) })] })] }), _jsx(IrAboutDialog, { isOpen: isAboutOpen, onClose: () => setIsAboutOpen(false) }), _jsx(IrDocumentationDialog, { isOpen: isDocumentationOpen, onClose: () => setIsDocumentationOpen(false) }), _jsx(ExportImageDialog, { isOpen: isExportImageOpen, getDrawing: chart.getDrawing, frame: "element", filename: pictureName(visibleSpectra, selectedSpectrum), label: "Infrared spectrum", onClose: () => setIsExportImageOpen(false) })] }));
134
+ }
135
+ /**
136
+ * What one press of zoom in or out is worth.
137
+ *
138
+ * A fifth, which is about what one notch of a mouse wheel does — so the button
139
+ * and the wheel feel like the same gesture at two speeds rather than two
140
+ * different ones.
141
+ */
142
+ const ZOOM_STEP = 1.2;
143
+ /** How wide a window a host gets when it asks to frame a band without saying. */
144
+ const DEFAULT_FRAME_WIDTH = 200;
145
+ /**
146
+ * What a picture of the chart is called before anything is typed in the box.
147
+ *
148
+ * The spectrum being looked at, since a figure of the chart is a figure of that
149
+ * spectrum, and a chemist who has one run open should not have to work out
150
+ * which of their downloads `spectra.png` was. A chart holding several and
151
+ * pointing at none of them is named after the lot.
152
+ * @param spectra - What is drawn.
153
+ * @param selected - The one being looked at, `null` when none is.
154
+ * @returns The name, without its extension.
155
+ */
156
+ function pictureName(spectra, selected) {
157
+ const named = selected ?? (spectra.length === 1 ? spectra[0] : undefined);
158
+ return named === undefined
159
+ ? 'spectra'
160
+ : sanitizeFileName(named.name, 'spectrum');
161
+ }
162
+ const rootStyle = {
163
+ display: 'flex',
164
+ flexDirection: 'column',
165
+ flex: '1 1 1px',
166
+ width: '100%',
167
+ height: '100%',
168
+ minHeight: 0,
169
+ outline: 'none',
170
+ };
171
+ const mainStyle = {
172
+ display: 'flex',
173
+ flex: '1 1 1px',
174
+ minWidth: 0,
175
+ minHeight: 0,
176
+ };
177
+ const railStyle = { flex: 'none' };
178
+ //# sourceMappingURL=IrShell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IrShell.js","sourceRoot":"","sources":["../../../src/ir/ui/IrShell.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAE5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAyC,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA8B,CAAC;AAGzD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAqB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAgB,CAAC;AAC1C,OAAO,E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AUG;AACH,SAAS,WAAW,CAClB,OAA8B,EAC9B,QAA2B;IAE3B,MAAM,KAAK,GAAG,QAAQ,IAAI,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAC1E,OAAO,KAAK,KAAK,SAAS;QACxB,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;AAC/C,CAAC;AAED,MAAM,SAAS,GAAG;IAChB,OAAO,EAAE,MAAM;IACf,aAAa,EAAE,QAAQ;IACvB,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,MAAM;IACb,MAAM,EAAE,MAAM;IACd,SAAS,EAAE,CAAC;IACZ,OAAO,EAAE,MAAM;CACP,CAAC;AAEX,MAAM,SAAS,GAAG;IAChB,OAAO,EAAE,MAAM;IACf,IAAI,EAAE,SAAS;IACf,QAAQ,EAAE,CAAC;IACX,SAAS,EAAE,CAAC;CACJ,CAAC;AAEX,MAAM,SAAS,GAAG,EAAE,IAAI,EAAE,MAAM,EAAW,CAAC"}
@@ -0,0 +1,26 @@
1
+ import type { IrBand } from '../core/irBand.ts';
2
+ export interface IrSidePanelProps {
3
+ /**
4
+ * The band the pointer is resting on.
5
+ * @default null
6
+ */
7
+ highlight?: IrBand | null;
8
+ /**
9
+ * Told when a row is hovered.
10
+ * @default undefined
11
+ */
12
+ onHighlight?: (band: IrBand | null) => void;
13
+ }
14
+ /**
15
+ * The panels that are open, stacked down the right.
16
+ *
17
+ * Every open panel gets a share of the height rather than a turn, because the
18
+ * things they hold are read together: which spectrum is selected and what its
19
+ * bands are is one question asked of two panels. The header carries the close
20
+ * button and nothing else — a panel's own actions are a toolbar inside its body,
21
+ * so they travel with it.
22
+ * @param props - Component props.
23
+ * @returns The panel stack.
24
+ */
25
+ export declare function IrSidePanel(props: IrSidePanelProps): import("react").JSX.Element;
26
+ //# sourceMappingURL=IrSidePanel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IrSidePanel.d.ts","sourceRoot":"","sources":["../../../src/ir/ui/IrSidePanel.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAShD,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CAC7C;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,+BAqBlD"}
@@ -0,0 +1,39 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { SidePanelStack } from "../../panel/ui/SidePanelStack.js";
3
+ import { irSidePanels } from "../core/irSidePanels.js";
4
+ import { BandsPanel } from "./BandsPanel.js";
5
+ import { MetadataPanel } from "./MetadataPanel.js";
6
+ import { SpectraPanel } from "./SpectraPanel.js";
7
+ import { useIrActions, useIrEditorState } from "./irStateContext.js";
8
+ /**
9
+ * The panels that are open, stacked down the right.
10
+ *
11
+ * Every open panel gets a share of the height rather than a turn, because the
12
+ * things they hold are read together: which spectrum is selected and what its
13
+ * bands are is one question asked of two panels. The header carries the close
14
+ * button and nothing else — a panel's own actions are a toolbar inside its body,
15
+ * so they travel with it.
16
+ * @param props - Component props.
17
+ * @returns The panel stack.
18
+ */
19
+ export function IrSidePanel(props) {
20
+ const { highlight = null, onHighlight } = props;
21
+ const { state } = useIrEditorState();
22
+ const actions = useIrActions();
23
+ const { openPanelIds } = state.view;
24
+ return (_jsx(SidePanelStack, { panels: irSidePanels, openPanelIds: openPanelIds, onClose: actions.togglePanel, children: (panel) => (_jsx(PanelBody, { panelId: panel.id, highlight: highlight, onHighlight: onHighlight })) }));
25
+ }
26
+ /**
27
+ * Which panel a panel id is.
28
+ * @param props - Component props.
29
+ * @returns The panel's body.
30
+ */
31
+ function PanelBody(props) {
32
+ const { panelId, highlight, onHighlight } = props;
33
+ if (panelId === 'spectra')
34
+ return _jsx(SpectraPanel, {});
35
+ if (panelId === 'metadata')
36
+ return _jsx(MetadataPanel, {});
37
+ return _jsx(BandsPanel, { highlight: highlight, onHighlight: onHighlight });
38
+ }
39
+ //# sourceMappingURL=IrSidePanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IrSidePanel.js","sourceRoot":"","sources":["../../../src/ir/ui/IrSidePanel.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAmC,CAAC;AAGnE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAkB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAqB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAoB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAerE;;;;;;;;;;GAUG;AACH,MAAM,UAAU,WAAW,CAAC,KAAuB;IACjD,MAAM,EAAE,SAAS,GAAG,IAAI,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;IAChD,MAAM,EAAE,KAAK,EAAE,GAAG,gBAAgB,EAAE,CAAC;IACrC,MAAM,OAAO,GAAG,YAAY,EAAE,CAAC;IAC/B,MAAM,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC;IAEpC,OAAO,CACL,KAAC,cAAc,IACb,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAE,OAAO,CAAC,WAAW,YAE3B,CAAC,KAAK,EAAE,EAAE,CAAC,CACV,KAAC,SAAS,IACR,OAAO,EAAE,KAAK,CAAC,EAAE,EACjB,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,GACxB,CACH,GACc,CAClB,CAAC;AACJ,CAAC;AAWD;;;;GAIG;AACH,SAAS,SAAS,CAAC,KAAqB;IACtC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;IAElD,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,KAAC,YAAY,KAAG,CAAC;IACnD,IAAI,OAAO,KAAK,UAAU;QAAE,OAAO,KAAC,aAAa,KAAG,CAAC;IACrD,OAAO,KAAC,UAAU,IAAC,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,GAAI,CAAC;AACxE,CAAC"}
@@ -0,0 +1,19 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { IrEditorApi } from './useIrEditor.ts';
3
+ export interface IrStateProviderProps {
4
+ /** The viewer's state, as `useIrEditor` holds it. */
5
+ editor: IrEditorApi;
6
+ /** The viewer. */
7
+ children: ReactNode;
8
+ }
9
+ /**
10
+ * Put one viewer's state where its panels can reach it.
11
+ *
12
+ * The state and the actions go into separate contexts on purpose — see
13
+ * `irStateContext.ts` for why — and the actions are handed over as they are,
14
+ * since `useIrEditor` already keeps them stable for the life of the viewer.
15
+ * @param props - Component props.
16
+ * @returns The provider.
17
+ */
18
+ export declare function IrStateProvider(props: IrStateProviderProps): import("react").JSX.Element;
19
+ //# sourceMappingURL=IrStateProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IrStateProvider.d.ts","sourceRoot":"","sources":["../../../src/ir/ui/IrStateProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,MAAM,WAAW,oBAAoB;IACnC,qDAAqD;IACrD,MAAM,EAAE,WAAW,CAAC;IACpB,kBAAkB;IAClB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,+BAU1D"}
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { actionsContext, stateContext } from "./irStateContext.js";
3
+ /**
4
+ * Put one viewer's state where its panels can reach it.
5
+ *
6
+ * The state and the actions go into separate contexts on purpose — see
7
+ * `irStateContext.ts` for why — and the actions are handed over as they are,
8
+ * since `useIrEditor` already keeps them stable for the life of the viewer.
9
+ * @param props - Component props.
10
+ * @returns The provider.
11
+ */
12
+ export function IrStateProvider(props) {
13
+ const { editor, children } = props;
14
+ return (_jsx(stateContext.Provider, { value: editor, children: _jsx(actionsContext.Provider, { value: editor.actions, children: children }) }));
15
+ }
16
+ //# sourceMappingURL=IrStateProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IrStateProvider.js","sourceRoot":"","sources":["../../../src/ir/ui/IrStateProvider.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAUnE;;;;;;;;GAQG;AACH,MAAM,UAAU,eAAe,CAAC,KAA2B;IACzD,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAEnC,OAAO,CACL,KAAC,YAAY,CAAC,QAAQ,IAAC,KAAK,EAAE,MAAM,YAClC,KAAC,cAAc,CAAC,QAAQ,IAAC,KAAK,EAAE,MAAM,CAAC,OAAO,YAC3C,QAAQ,GACe,GACJ,CACzB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * The one line under the chart: what is drawn, what was found, what went wrong.
3
+ *
4
+ * Everything in it is derived, so it is the cheapest place in the viewer to
5
+ * answer "did that work" — how many spectra are drawn of those open, how many
6
+ * bands the picking found and how many the table had something to say about, and
7
+ * the range the selected spectrum covers.
8
+ *
9
+ * The refusal is last and is the only red in the shell, so the eye that has just
10
+ * pressed something and seen nothing happen lands on the reason.
11
+ * @returns The status bar.
12
+ */
13
+ export declare function IrStatusBar(): import("react").JSX.Element;
14
+ //# sourceMappingURL=IrStatusBar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IrStatusBar.d.ts","sourceRoot":"","sources":["../../../src/ir/ui/IrStatusBar.tsx"],"names":[],"mappings":"AAeA;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,gCAmD1B"}
@@ -0,0 +1,48 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Icon } from '@blueprintjs/core';
3
+ import { countLabel, statusBarStyle as barStyle, statusItemStyle as itemStyle, statusMutedStyle as mutedStyle, statusSpacerStyle as spacerStyle, } from "../../panel/core/statusBar.js";
4
+ import { countAssigned } from "../core/assignBands.js";
5
+ import { formatWavenumber } from "../core/irFormat.js";
6
+ import { boxZoomOnly, yAxisTitle } from "../core/irMode.js";
7
+ import { useIrEditorState } from "./irStateContext.js";
8
+ /**
9
+ * The one line under the chart: what is drawn, what was found, what went wrong.
10
+ *
11
+ * Everything in it is derived, so it is the cheapest place in the viewer to
12
+ * answer "did that work" — how many spectra are drawn of those open, how many
13
+ * bands the picking found and how many the table had something to say about, and
14
+ * the range the selected spectrum covers.
15
+ *
16
+ * The refusal is last and is the only red in the shell, so the eye that has just
17
+ * pressed something and seen nothing happen lands on the reason.
18
+ * @returns The status bar.
19
+ */
20
+ export function IrStatusBar() {
21
+ const { state, visibleSpectra, selectedSpectrum, assigned } = useIrEditorState();
22
+ const { spectra } = state.data;
23
+ const { error, tool } = state.view;
24
+ const { mode, pickBands } = state.settings;
25
+ const range = selectedSpectrum === null || selectedSpectrum.wavenumber.length === 0
26
+ ? null
27
+ : `${formatWavenumber(selectedSpectrum.wavenumber.at(-1))}–${formatWavenumber(selectedSpectrum.wavenumber[0])} cm⁻¹`;
28
+ return (_jsxs("div", { style: barStyle, children: [_jsx("span", { style: itemStyle, children: spectra.length === 0
29
+ ? 'no spectrum open'
30
+ : `${countLabel(visibleSpectra.length, 'spectrum', 'spectra')} drawn of ${spectra.length}` }), _jsx("span", { style: itemStyle, children: yAxisTitle(mode) }), selectedSpectrum === null ? null : (_jsx("span", { style: nameStyle, title: selectedSpectrum.name, children: selectedSpectrum.name })), range === null ? null : _jsx("span", { style: mutedStyle, children: range }), pickBands && assigned.length > 0 ? (_jsxs("span", { style: itemStyle, children: [countLabel(assigned.length, 'band', 'bands'), ",", ' ', countAssigned(assigned), " assigned"] })) : null, boxZoomOnly(mode) || tool === 'box' ? (_jsx("span", { style: mutedStyle, children: "square zoom: drag a rectangle" })) : null, _jsx("span", { style: spacerStyle }), error === null ? null : (_jsxs("span", { style: errorStyle, title: error, children: [_jsx(Icon, { icon: "warning-sign", size: 12 }), error] }))] }));
31
+ }
32
+ const nameStyle = {
33
+ ...itemStyle,
34
+ overflow: 'hidden',
35
+ textOverflow: 'ellipsis',
36
+ maxWidth: '32%',
37
+ fontWeight: 600,
38
+ };
39
+ /** The one red in the shell: a refusal, and nothing else, is written in it. */
40
+ const errorStyle = {
41
+ ...itemStyle,
42
+ gap: 4,
43
+ color: '#C0392B',
44
+ overflow: 'hidden',
45
+ textOverflow: 'ellipsis',
46
+ maxWidth: '60%',
47
+ };
48
+ //# sourceMappingURL=IrStatusBar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IrStatusBar.js","sourceRoot":"","sources":["../../../src/ir/ui/IrStatusBar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,OAAO,EACL,UAAU,EACV,cAAc,IAAI,QAAQ,EAC1B,eAAe,IAAI,SAAS,EAC5B,gBAAgB,IAAI,UAAU,EAC9B,iBAAiB,IAAI,WAAW,GACjC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,m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K,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,eAAM,KAAK,EAAE,UAAU,YAAG,KAAK,GAAQ,EAE/D,SAAS,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAClC,gBAAM,KAAK,EAAE,SAAS,aACnB,UAAU,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,OAAG,GAAG,EAClD,aAAa,CAAC,QAAQ,CAAC,iBACnB,CACR,CAAC,CAAC,CAAC,IAAI,EAEP,WAAW,CAAC,IAAI,CAAC,IAAI,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,CACrC,eAAM,KAAK,EAAE,UAAU,8CAAsC,CAC9D,CAAC,CAAC,CAAC,IAAI,EAER,eAAM,KAAK,EAAE,WAAW,GAAI,EAE3B,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CACvB,gBAAM,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,aACnC,KAAC,IAAI,IAAC,IAAI,EAAC,cAAc,EAAC,IAAI,EAAE,EAAE,GAAI,EACrC,KAAK,IACD,CACR,IACG,CACP,CAAC;AACJ,CAAC;AAED,MAAM,SAAS,GAAG;IAChB,GAAG,SAAS;IACZ,QAAQ,EAAE,QAAQ;IAClB,YAAY,EAAE,UAAU;IACxB,QAAQ,EAAE,KAAK;IACf,UAAU,EAAE,GAAG;CACP,CAAC;AAEX,+EAA+E;AAC/E,MAAM,UAAU,GAAG;IACjB,GAAG,SAAS;IACZ,GAAG,EAAE,CAAC;IACN,KAAK,EAAE,SAAS;IAChB,QAAQ,EAAE,QAAQ;IAClB,YAAY,EAAE,UAAU;IACxB,QAAQ,EAAE,KAAK;CACP,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * The tools, down the left of the chart.
3
+ *
4
+ * Only what is done to the spectra: what is asked of the viewer itself — the
5
+ * mark, help, full screen — is in the header. The two **tools** — read and
6
+ * square zoom — come first and show which of the two a drag is currently
7
+ * running, then the zoom commands that act at once, then what is being read: the
8
+ * value axis, the picking, the assignments. Closing every spectrum is last and
9
+ * alone, being the only one that throws something away.
10
+ *
11
+ * Reading percent transmittance, the pair is settled rather than chosen: every
12
+ * drag on that axis is a rectangle, so both buttons go dead with the square zoom
13
+ * lit. Showing `read` as available there would offer a gesture the chart does not
14
+ * make, and showing it as *active* would name the wrong one.
15
+ * @returns The toolbar.
16
+ */
17
+ export declare function IrToolbar(): import("react").JSX.Element;
18
+ //# sourceMappingURL=IrToolbar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IrToolbar.d.ts","sourceRoot":"","sources":["../../../src/ir/ui/IrToolbar.tsx"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,SAAS,gCA8ExB"}
@@ -0,0 +1,32 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Toolbar } from 'react-science/ui';
3
+ import { boxZoomOnly } from "../core/irMode.js";
4
+ import { useIrCommandProps } from "./irCommandContext.js";
5
+ import { useIrEditorState } from "./irStateContext.js";
6
+ /**
7
+ * The tools, down the left of the chart.
8
+ *
9
+ * Only what is done to the spectra: what is asked of the viewer itself — the
10
+ * mark, help, full screen — is in the header. The two **tools** — read and
11
+ * square zoom — come first and show which of the two a drag is currently
12
+ * running, then the zoom commands that act at once, then what is being read: the
13
+ * value axis, the picking, the assignments. Closing every spectrum is last and
14
+ * alone, being the only one that throws something away.
15
+ *
16
+ * Reading percent transmittance, the pair is settled rather than chosen: every
17
+ * drag on that axis is a rectangle, so both buttons go dead with the square zoom
18
+ * lit. Showing `read` as available there would offer a gesture the chart does not
19
+ * make, and showing it as *active* would name the wrong one.
20
+ * @returns The toolbar.
21
+ */
22
+ export function IrToolbar() {
23
+ const { state, selectedSpectrum } = useIrEditorState();
24
+ const command = useIrCommandProps();
25
+ const { spectra } = state.data;
26
+ const { domain, tool } = state.view;
27
+ const { mode, pickBands, showAssignments } = state.settings;
28
+ const isEmpty = spectra.length === 0;
29
+ const settled = boxZoomOnly(mode);
30
+ return (_jsxs(Toolbar, { vertical: true, overflow: "collapse", "aria-label": "Infrared spectrum tools", children: [_jsx(Toolbar.Item, { icon: "trash", intent: "danger", ...command('clear'), disabled: isEmpty }), _jsx(Toolbar.Item, { icon: "arrows-horizontal", active: !settled && tool === 'read', ...command('readTool'), disabled: isEmpty || settled }), _jsx(Toolbar.Item, { icon: "select", active: settled || tool === 'box', ...command('boxTool'), disabled: isEmpty || settled }), _jsx(Toolbar.Item, { icon: "zoom-in", ...command('zoomIn'), disabled: isEmpty }), _jsx(Toolbar.Item, { icon: "zoom-out", ...command('zoomOut'), disabled: isEmpty }), _jsx(Toolbar.Item, { icon: "zoom-to-fit", ...command('resetZoom'), disabled: domain === null }), _jsx(Toolbar.Item, { icon: mode === 'absorbance' ? 'arrow-up' : 'arrow-down', active: mode === 'absorbance', ...command('toggleMode'), disabled: isEmpty }), _jsx(Toolbar.Item, { icon: "locate", active: pickBands, ...command('togglePicking'), disabled: selectedSpectrum === null }), _jsx(Toolbar.Item, { icon: "label", active: showAssignments, ...command('toggleAssignments'), disabled: !pickBands || selectedSpectrum === null }), _jsx(Toolbar.Item, { icon: "media", ...command('exportImage'), disabled: isEmpty })] }));
31
+ }
32
+ //# sourceMappingURL=IrToolbar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IrToolbar.js","sourceRoot":"","sources":["../../../src/ir/ui/IrToolbar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAwB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,SAAS;IACvB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,QAAQ,EAAE,OAAO,GACjB,EACF,KAAC,OAAO,CAAC,IAAI,IACX,IAAI,EAAC,aAAa,KACd,OAAO,CAAC,WAAW,CAAC,EACxB,QAAQ,EAAE,MAAM,KAAK,IAAI,GACzB,EAEF,KAAC,OAAO,CAAC,IAAI,IACX,IAAI,EAAE,IAAI,KAAK,YAAY,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY,EACvD,MAAM,EAAE,IAAI,KAAK,YAAY,KACzB,OAAO,CAAC,YAAY,CAAC,EACzB,QAAQ,EAAE,OAAO,GACjB,EACF,KAAC,OAAO,CAAC,IAAI,IACX,IAAI,EAAC,QAAQ,EACb,MAAM,EAAE,SAAS,KACb,OAAO,CAAC,eAAe,CAAC,EAC5B,QAAQ,EAAE,gBAAgB,KAAK,IAAI,GACnC,EACF,KAAC,OAAO,CAAC,IAAI,IACX,IAAI,EAAC,OAAO,EACZ,MAAM,EAAE,eAAe,KACnB,OAAO,CAAC,mBAAmB,CAAC,EAChC,QAAQ,EAAE,CAAC,SAAS,IAAI,gBAAgB,KAAK,IAAI,GACjD,EAMF,KAAC,OAAO,CAAC,IAAI,IACX,IAAI,EAAC,OAAO,KACR,OAAO,CAAC,aAAa,CAAC,EAC1B,QAAQ,EAAE,OAAO,GACjB,IACM,CACX,CAAC;AACJ,CAAC"}
@@ -0,0 +1,63 @@
1
+ import type { ReactElement } from 'react';
2
+ import type { PlotRect } from '../../chart/core/chartGeometry.ts';
3
+ import type { ChartScale } from '../../chart/core/chartScale.ts';
4
+ import type { IrMode, IrSpectrum } from '../core/irSpectrum.ts';
5
+ export interface IrTracesProps {
6
+ /** The spectra to draw, each saying in itself whether it is drawn. */
7
+ spectra: readonly IrSpectrum[];
8
+ /** Which value axis is being drawn. */
9
+ mode: IrMode;
10
+ /**
11
+ * Where the plot sits, whose width is how many points are worth drawing. A
12
+ * trace is reduced to the pixel columns it will occupy, so the width is what
13
+ * says how much of a spectrum the chart can actually show.
14
+ */
15
+ plot: PlotRect;
16
+ /**
17
+ * The window being shown, low end first — which is what the reduction is cut
18
+ * to. Read from the window rather than inverted back out of `xScale`, because
19
+ * the wavenumber axis runs right to left and inverting its left edge gives
20
+ * the *high* end, the opposite of what every other chart's does.
21
+ */
22
+ xDomain: readonly [number, number];
23
+ /** The wavenumber axis as it is currently zoomed, running right to left. */
24
+ xScale: ChartScale;
25
+ /** The value axis as it is currently zoomed. */
26
+ yScale: ChartScale;
27
+ /**
28
+ * Identity of the spectrum drawn thicker than the rest, `null` for none. The
29
+ * one every panel beside the chart is about, so that which trace the numbers
30
+ * belong to can be seen rather than inferred from a colour swatch.
31
+ * @default null
32
+ */
33
+ emphasisedId?: string | null;
34
+ }
35
+ /**
36
+ * Every visible spectrum, one `<path>` each.
37
+ *
38
+ * One path per spectrum and never one element per point: an infrared spectrum is
39
+ * a few thousand samples, and drawn as a line each the browser holds thousands of
40
+ * nodes for a picture that is a single stroke — and every pointer move across the
41
+ * chart then costs a walk of all of them.
42
+ *
43
+ * Nor every sample: a spectrum is reduced to the pixel columns it will occupy
44
+ * before it becomes a path. A bench instrument's 1 cm⁻¹ grid over 4000–400 is
45
+ * some eight thousand samples against a plot around thirteen hundred pixels
46
+ * wide, and a chart holding the four infrared blocks of one JCAMP file writes
47
+ * a fifth of a megabyte of `d` for a picture no denser than the one it would
48
+ * have drawn from a tenth of that. `xyReduce` keeps the lowest and the highest
49
+ * sample of every slot, so a band still reaches its true depth rather than the
50
+ * depth of whichever sample a slot boundary happened to land on — and it cuts
51
+ * by wavenumber rather than by index, which is what makes it safe on the
52
+ * uneven grids a converted or interpolated file arrives on.
53
+ *
54
+ * There is no stick trace here and no mirror mode, which is the visible
55
+ * difference from a mass chart: infrared is a continuous absorption profile, the
56
+ * bands are features *of* that curve rather than a second representation of it,
57
+ * and two spectra are compared by drawing them over one another rather than head
58
+ * to head — the baselines have to line up for the comparison to mean anything.
59
+ * @param props - Component props.
60
+ * @returns The traces, as SVG.
61
+ */
62
+ export declare function IrTraces(props: IrTracesProps): ReactElement;
63
+ //# sourceMappingURL=IrTraces.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IrTraces.d.ts","sourceRoot":"","sources":["../../../src/ir/ui/IrTraces.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAEjE,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGhE,MAAM,WAAW,aAAa;IAC5B,sEAAsE;IACtE,OAAO,EAAE,SAAS,UAAU,EAAE,CAAC;IAC/B,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,IAAI,EAAE,QAAQ,CAAC;IACf;;;;;OAKG;IACH,OAAO,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,4EAA4E;IAC5E,MAAM,EAAE,UAAU,CAAC;IACnB,gDAAgD;IAChD,MAAM,EAAE,UAAU,CAAC;IACnB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,YAAY,CA0C3D"}
@@ -0,0 +1,72 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { xyReduce } from 'ml-spectra-processing';
3
+ import { useMemo } from 'react';
4
+ import { profilePath } from "../../chart/core/tracePath.js";
5
+ import { traceOf } from "../core/irSpectrum.js";
6
+ /**
7
+ * Every visible spectrum, one `<path>` each.
8
+ *
9
+ * One path per spectrum and never one element per point: an infrared spectrum is
10
+ * a few thousand samples, and drawn as a line each the browser holds thousands of
11
+ * nodes for a picture that is a single stroke — and every pointer move across the
12
+ * chart then costs a walk of all of them.
13
+ *
14
+ * Nor every sample: a spectrum is reduced to the pixel columns it will occupy
15
+ * before it becomes a path. A bench instrument's 1 cm⁻¹ grid over 4000–400 is
16
+ * some eight thousand samples against a plot around thirteen hundred pixels
17
+ * wide, and a chart holding the four infrared blocks of one JCAMP file writes
18
+ * a fifth of a megabyte of `d` for a picture no denser than the one it would
19
+ * have drawn from a tenth of that. `xyReduce` keeps the lowest and the highest
20
+ * sample of every slot, so a band still reaches its true depth rather than the
21
+ * depth of whichever sample a slot boundary happened to land on — and it cuts
22
+ * by wavenumber rather than by index, which is what makes it safe on the
23
+ * uneven grids a converted or interpolated file arrives on.
24
+ *
25
+ * There is no stick trace here and no mirror mode, which is the visible
26
+ * difference from a mass chart: infrared is a continuous absorption profile, the
27
+ * bands are features *of* that curve rather than a second representation of it,
28
+ * and two spectra are compared by drawing them over one another rather than head
29
+ * to head — the baselines have to line up for the comparison to mean anything.
30
+ * @param props - Component props.
31
+ * @returns The traces, as SVG.
32
+ */
33
+ export function IrTraces(props) {
34
+ const { spectra, mode, plot, xDomain, xScale, yScale, emphasisedId = null, } = props;
35
+ const [from, to] = xDomain;
36
+ const wanted = Math.max(2, Math.round(plot.width)) * POINTS_PER_COLUMN;
37
+ const paths = useMemo(() => {
38
+ const drawn = [];
39
+ for (const spectrum of spectra) {
40
+ if (!spectrum.visible)
41
+ continue;
42
+ const trace = traceOf(spectrum, mode);
43
+ const { x, y } = xyReduce(trace, { from, to, nbPoints: wanted });
44
+ const d = profilePath(x, y, xScale, yScale);
45
+ if (d !== '')
46
+ drawn.push({ id: spectrum.id, color: spectrum.color, d });
47
+ }
48
+ return drawn;
49
+ }, [spectra, mode, from, to, wanted, xScale, yScale]);
50
+ return (_jsx("g", { pointerEvents: "none", children: paths.map((path) => (_jsx("path", { d: path.d, fill: "none", stroke: path.color, strokeWidth: path.id === emphasisedId ? EMPHASISED_WIDTH : TRACE_WIDTH, strokeLinejoin: "round" }, path.id))) }));
51
+ }
52
+ /**
53
+ * How many reduced samples each pixel column is given.
54
+ *
55
+ * The reduction keeps the lowest and the highest sample of every slot, so two
56
+ * per column is the least that draws a column at all — and `xyReduce` asks for
57
+ * about four times what is displayed before a narrow band survives at its true
58
+ * depth rather than at the depth of whichever sample the slot boundary happened
59
+ * to land on.
60
+ */
61
+ const POINTS_PER_COLUMN = 4;
62
+ /** How thick a trace is drawn. */
63
+ const TRACE_WIDTH = 1;
64
+ /**
65
+ * How thick the one every panel is about is drawn.
66
+ *
67
+ * Barely thicker, because the difference has to be visible without reading as a
68
+ * different kind of thing: at two pixels a trace still looks like the others,
69
+ * where at three it looks like a fit or an envelope drawn over them.
70
+ */
71
+ const EMPHASISED_WIDTH = 2;
72
+ //# sourceMappingURL=IrTraces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IrTraces.js","sourceRoot":"","sources":["../../../src/ir/ui/IrTraces.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAIhC,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAE5D,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAiChD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,UAAU,QAAQ,CAAC,KAAoB;IAC3C,MAAM,EACJ,OAAO,EACP,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,MAAM,EACN,MAAM,EACN,YAAY,GAAG,IAAI,GACpB,GAAG,KAAK,CAAC;IAEV,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,OAAO,CAAC;IAC3B,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,iBAAiB,CAAC;IAEvE,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG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