react-cheminfo 0.76.0 → 0.78.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 (389) hide show
  1. package/README.md +141 -31
  2. package/lib/card/core/cardAddress.d.ts +19 -2
  3. package/lib/card/core/cardAddress.d.ts.map +1 -1
  4. package/lib/card/core/cardAddress.js +35 -2
  5. package/lib/card/core/cardAddress.js.map +1 -1
  6. package/lib/card/core/cardPageUrl.d.ts +7 -1
  7. package/lib/card/core/cardPageUrl.d.ts.map +1 -1
  8. package/lib/card/core/cardPageUrl.js +4 -2
  9. package/lib/card/core/cardPageUrl.js.map +1 -1
  10. package/lib/card/core/index.d.ts +1 -1
  11. package/lib/card/core/index.d.ts.map +1 -1
  12. package/lib/card/core/index.js +1 -1
  13. package/lib/card/core/index.js.map +1 -1
  14. package/lib/credits/core/credits.d.ts +30 -0
  15. package/lib/credits/core/credits.d.ts.map +1 -1
  16. package/lib/credits/core/credits.js +35 -0
  17. package/lib/credits/core/credits.js.map +1 -1
  18. package/lib/download/core/downloadFigure.d.ts +12 -1
  19. package/lib/download/core/downloadFigure.d.ts.map +1 -1
  20. package/lib/download/core/downloadFigure.js +21 -0
  21. package/lib/download/core/downloadFigure.js.map +1 -1
  22. package/lib/download/core/figureDpi.d.ts +59 -0
  23. package/lib/download/core/figureDpi.d.ts.map +1 -0
  24. package/lib/download/core/figureDpi.js +75 -0
  25. package/lib/download/core/figureDpi.js.map +1 -0
  26. package/lib/download/core/figurePng.d.ts +4 -1
  27. package/lib/download/core/figurePng.d.ts.map +1 -1
  28. package/lib/download/core/figurePng.js +11 -2
  29. package/lib/download/core/figurePng.js.map +1 -1
  30. package/lib/download/core/index.d.ts +4 -1
  31. package/lib/download/core/index.d.ts.map +1 -1
  32. package/lib/download/core/index.js +3 -1
  33. package/lib/download/core/index.js.map +1 -1
  34. package/lib/download/core/pngDpi.d.ts +22 -0
  35. package/lib/download/core/pngDpi.d.ts.map +1 -0
  36. package/lib/download/core/pngDpi.js +79 -0
  37. package/lib/download/core/pngDpi.js.map +1 -0
  38. package/lib/download/ui/FigureDownloadPanel.d.ts +13 -0
  39. package/lib/download/ui/FigureDownloadPanel.d.ts.map +1 -1
  40. package/lib/download/ui/FigureDownloadPanel.js +18 -34
  41. package/lib/download/ui/FigureDownloadPanel.js.map +1 -1
  42. package/lib/download/ui/figureDownloadHint.d.ts +5 -0
  43. package/lib/download/ui/figureDownloadHint.d.ts.map +1 -1
  44. package/lib/download/ui/figureDownloadHint.js +8 -0
  45. package/lib/download/ui/figureDownloadHint.js.map +1 -1
  46. package/lib/download/ui/figureDownloadOptions.d.ts +84 -0
  47. package/lib/download/ui/figureDownloadOptions.d.ts.map +1 -0
  48. package/lib/download/ui/figureDownloadOptions.js +2 -0
  49. package/lib/download/ui/figureDownloadOptions.js.map +1 -0
  50. package/lib/download/ui/resolutionChoices.d.ts +27 -0
  51. package/lib/download/ui/resolutionChoices.d.ts.map +1 -0
  52. package/lib/download/ui/resolutionChoices.js +48 -0
  53. package/lib/download/ui/resolutionChoices.js.map +1 -0
  54. package/lib/download/ui/useFigureActions.d.ts +4 -1
  55. package/lib/download/ui/useFigureActions.d.ts.map +1 -1
  56. package/lib/download/ui/useFigureActions.js +17 -8
  57. package/lib/download/ui/useFigureActions.js.map +1 -1
  58. package/lib/download/ui/useFigureDownload.d.ts +2 -55
  59. package/lib/download/ui/useFigureDownload.d.ts.map +1 -1
  60. package/lib/download/ui/useFigureDownload.js +45 -13
  61. package/lib/download/ui/useFigureDownload.js.map +1 -1
  62. package/lib/ecosystem/core/sites.d.ts.map +1 -1
  63. package/lib/ecosystem/core/sites.js +14 -0
  64. package/lib/ecosystem/core/sites.js.map +1 -1
  65. package/lib/ecosystem/core/types.d.ts +1 -1
  66. package/lib/ecosystem/core/types.d.ts.map +1 -1
  67. package/lib/ecosystem/ui/glyphs.d.ts.map +1 -1
  68. package/lib/ecosystem/ui/glyphs.js +3 -0
  69. package/lib/ecosystem/ui/glyphs.js.map +1 -1
  70. package/lib/host/core/connectHost.js +1 -1
  71. package/lib/host/core/connectHost.js.map +1 -1
  72. package/lib/host/core/connectTool.d.ts +103 -0
  73. package/lib/host/core/connectTool.d.ts.map +1 -0
  74. package/lib/host/core/connectTool.js +169 -0
  75. package/lib/host/core/connectTool.js.map +1 -0
  76. package/lib/host/core/hostOutputs.d.ts +16 -3
  77. package/lib/host/core/hostOutputs.d.ts.map +1 -1
  78. package/lib/host/core/hostOutputs.js +38 -4
  79. package/lib/host/core/hostOutputs.js.map +1 -1
  80. package/lib/host/core/index.d.ts +8 -2
  81. package/lib/host/core/index.d.ts.map +1 -1
  82. package/lib/host/core/index.js +4 -1
  83. package/lib/host/core/index.js.map +1 -1
  84. package/lib/host/core/kinds.d.ts +31 -3
  85. package/lib/host/core/kinds.d.ts.map +1 -1
  86. package/lib/host/core/kinds.js +35 -4
  87. package/lib/host/core/kinds.js.map +1 -1
  88. package/lib/host/core/messageValues.d.ts +29 -0
  89. package/lib/host/core/messageValues.d.ts.map +1 -0
  90. package/lib/host/core/messageValues.js +57 -0
  91. package/lib/host/core/messageValues.js.map +1 -0
  92. package/lib/host/core/protocol.d.ts +2 -5
  93. package/lib/host/core/protocol.d.ts.map +1 -1
  94. package/lib/host/core/protocol.js +3 -37
  95. package/lib/host/core/protocol.js.map +1 -1
  96. package/lib/host/core/resultKinds.d.ts +74 -0
  97. package/lib/host/core/resultKinds.d.ts.map +1 -0
  98. package/lib/host/core/resultKinds.js +40 -0
  99. package/lib/host/core/resultKinds.js.map +1 -0
  100. package/lib/host/core/toolMessages.d.ts +24 -0
  101. package/lib/host/core/toolMessages.d.ts.map +1 -0
  102. package/lib/host/core/toolMessages.js +136 -0
  103. package/lib/host/core/toolMessages.js.map +1 -0
  104. package/lib/host/ui/index.d.ts +2 -0
  105. package/lib/host/ui/index.d.ts.map +1 -1
  106. package/lib/host/ui/index.js +1 -0
  107. package/lib/host/ui/index.js.map +1 -1
  108. package/lib/host/ui/useFramedTool.d.ts +74 -0
  109. package/lib/host/ui/useFramedTool.d.ts.map +1 -0
  110. package/lib/host/ui/useFramedTool.js +125 -0
  111. package/lib/host/ui/useFramedTool.js.map +1 -0
  112. package/lib/i18n/core/chromeCatalog.d.ts +1 -1
  113. package/lib/i18n/core/chromeCatalog.d.ts.map +1 -1
  114. package/lib/locales/de.json +30 -1
  115. package/lib/locales/en.json +30 -1
  116. package/lib/locales/es.json +30 -1
  117. package/lib/locales/fr.json +30 -1
  118. package/lib/locales/it.json +30 -1
  119. package/lib/molecule3d/ui/Molecule3DStage.d.ts +4 -33
  120. package/lib/molecule3d/ui/Molecule3DStage.d.ts.map +1 -1
  121. package/lib/molecule3d/ui/Molecule3DStage.js +3 -37
  122. package/lib/molecule3d/ui/Molecule3DStage.js.map +1 -1
  123. package/lib/molecule3d/ui/MoleculeCanvas3D.d.ts.map +1 -1
  124. package/lib/molecule3d/ui/MoleculeCanvas3D.js +10 -2
  125. package/lib/molecule3d/ui/MoleculeCanvas3D.js.map +1 -1
  126. package/lib/molecule3d/ui/exportMoleculeImage.d.ts +10 -0
  127. package/lib/molecule3d/ui/exportMoleculeImage.d.ts.map +1 -1
  128. package/lib/molecule3d/ui/exportMoleculeImage.js +17 -0
  129. package/lib/molecule3d/ui/exportMoleculeImage.js.map +1 -1
  130. package/lib/molecule3d/ui/index.d.ts +1 -1
  131. package/lib/molecule3d/ui/index.d.ts.map +1 -1
  132. package/lib/molecule3d/ui/moleculeViewer3DProps.d.ts +23 -0
  133. package/lib/molecule3d/ui/moleculeViewer3DProps.d.ts.map +1 -1
  134. package/lib/molecule3d/ui/useImageExport.d.ts +3 -0
  135. package/lib/molecule3d/ui/useImageExport.d.ts.map +1 -1
  136. package/lib/molecule3d/ui/useImageExport.js +21 -3
  137. package/lib/molecule3d/ui/useImageExport.js.map +1 -1
  138. package/lib/osiris/core/barGeometry.d.ts +42 -0
  139. package/lib/osiris/core/barGeometry.d.ts.map +1 -0
  140. package/lib/osiris/core/barGeometry.js +46 -0
  141. package/lib/osiris/core/barGeometry.js.map +1 -0
  142. package/lib/osiris/core/computeProperties.d.ts +42 -0
  143. package/lib/osiris/core/computeProperties.d.ts.map +1 -0
  144. package/lib/osiris/core/computeProperties.js +115 -0
  145. package/lib/osiris/core/computeProperties.js.map +1 -0
  146. package/lib/osiris/core/constants.d.ts +70 -0
  147. package/lib/osiris/core/constants.d.ts.map +1 -0
  148. package/lib/osiris/core/constants.js +99 -0
  149. package/lib/osiris/core/constants.js.map +1 -0
  150. package/lib/osiris/core/fitness.d.ts +32 -0
  151. package/lib/osiris/core/fitness.d.ts.map +1 -0
  152. package/lib/osiris/core/fitness.js +48 -0
  153. package/lib/osiris/core/fitness.js.map +1 -0
  154. package/lib/osiris/core/index.d.ts +29 -0
  155. package/lib/osiris/core/index.d.ts.map +1 -0
  156. package/lib/osiris/core/index.js +19 -0
  157. package/lib/osiris/core/index.js.map +1 -0
  158. package/lib/osiris/core/poolSize.d.ts +17 -0
  159. package/lib/osiris/core/poolSize.d.ts.map +1 -0
  160. package/lib/osiris/core/poolSize.js +22 -0
  161. package/lib/osiris/core/poolSize.js.map +1 -0
  162. package/lib/osiris/core/poolTypes.d.ts +140 -0
  163. package/lib/osiris/core/poolTypes.d.ts.map +1 -0
  164. package/lib/osiris/core/poolTypes.js +12 -0
  165. package/lib/osiris/core/poolTypes.js.map +1 -0
  166. package/lib/osiris/core/predictIdCode.d.ts +39 -0
  167. package/lib/osiris/core/predictIdCode.d.ts.map +1 -0
  168. package/lib/osiris/core/predictIdCode.js +54 -0
  169. package/lib/osiris/core/predictIdCode.js.map +1 -0
  170. package/lib/osiris/core/predictProtocol.d.ts +67 -0
  171. package/lib/osiris/core/predictProtocol.d.ts.map +1 -0
  172. package/lib/osiris/core/predictProtocol.js +29 -0
  173. package/lib/osiris/core/predictProtocol.js.map +1 -0
  174. package/lib/osiris/core/predictionPool.d.ts +23 -0
  175. package/lib/osiris/core/predictionPool.d.ts.map +1 -0
  176. package/lib/osiris/core/predictionPool.js +186 -0
  177. package/lib/osiris/core/predictionPool.js.map +1 -0
  178. package/lib/osiris/core/predictionQueue.d.ts +46 -0
  179. package/lib/osiris/core/predictionQueue.d.ts.map +1 -0
  180. package/lib/osiris/core/predictionQueue.js +57 -0
  181. package/lib/osiris/core/predictionQueue.js.map +1 -0
  182. package/lib/osiris/core/predictors.d.ts +62 -0
  183. package/lib/osiris/core/predictors.d.ts.map +1 -0
  184. package/lib/osiris/core/predictors.js +100 -0
  185. package/lib/osiris/core/predictors.js.map +1 -0
  186. package/lib/osiris/core/propertyKeys.d.ts +32 -0
  187. package/lib/osiris/core/propertyKeys.d.ts.map +1 -0
  188. package/lib/osiris/core/propertyKeys.js +44 -0
  189. package/lib/osiris/core/propertyKeys.js.map +1 -0
  190. package/lib/osiris/core/riskAppearance.d.ts +60 -0
  191. package/lib/osiris/core/riskAppearance.d.ts.map +1 -0
  192. package/lib/osiris/core/riskAppearance.js +59 -0
  193. package/lib/osiris/core/riskAppearance.js.map +1 -0
  194. package/lib/osiris/core/riskDetail.d.ts +22 -0
  195. package/lib/osiris/core/riskDetail.d.ts.map +1 -0
  196. package/lib/osiris/core/riskDetail.js +86 -0
  197. package/lib/osiris/core/riskDetail.js.map +1 -0
  198. package/lib/osiris/core/riskDetailRequest.d.ts +31 -0
  199. package/lib/osiris/core/riskDetailRequest.d.ts.map +1 -0
  200. package/lib/osiris/core/riskDetailRequest.js +49 -0
  201. package/lib/osiris/core/riskDetailRequest.js.map +1 -0
  202. package/lib/osiris/core/riskFindings.d.ts +26 -0
  203. package/lib/osiris/core/riskFindings.d.ts.map +1 -0
  204. package/lib/osiris/core/riskFindings.js +79 -0
  205. package/lib/osiris/core/riskFindings.js.map +1 -0
  206. package/lib/osiris/core/runPredictionJob.d.ts +20 -0
  207. package/lib/osiris/core/runPredictionJob.d.ts.map +1 -0
  208. package/lib/osiris/core/runPredictionJob.js +43 -0
  209. package/lib/osiris/core/runPredictionJob.js.map +1 -0
  210. package/lib/osiris/core/scales.d.ts +70 -0
  211. package/lib/osiris/core/scales.d.ts.map +1 -0
  212. package/lib/osiris/core/scales.js +185 -0
  213. package/lib/osiris/core/scales.js.map +1 -0
  214. package/lib/osiris/core/types.d.ts +91 -0
  215. package/lib/osiris/core/types.d.ts.map +1 -0
  216. package/lib/osiris/core/types.js +19 -0
  217. package/lib/osiris/core/types.js.map +1 -0
  218. package/lib/osiris/core/valuation.d.ts +28 -0
  219. package/lib/osiris/core/valuation.d.ts.map +1 -0
  220. package/lib/osiris/core/valuation.js +39 -0
  221. package/lib/osiris/core/valuation.js.map +1 -0
  222. package/lib/osiris/ui/PropertyBar.d.ts +27 -0
  223. package/lib/osiris/ui/PropertyBar.d.ts.map +1 -0
  224. package/lib/osiris/ui/PropertyBar.js +27 -0
  225. package/lib/osiris/ui/PropertyBar.js.map +1 -0
  226. package/lib/osiris/ui/PropertyPanel.d.ts +91 -0
  227. package/lib/osiris/ui/PropertyPanel.d.ts.map +1 -0
  228. package/lib/osiris/ui/PropertyPanel.js +77 -0
  229. package/lib/osiris/ui/PropertyPanel.js.map +1 -0
  230. package/lib/osiris/ui/PropertyRows.d.ts +40 -0
  231. package/lib/osiris/ui/PropertyRows.d.ts.map +1 -0
  232. package/lib/osiris/ui/PropertyRows.js +23 -0
  233. package/lib/osiris/ui/PropertyRows.js.map +1 -0
  234. package/lib/osiris/ui/RiskFindings.d.ts +43 -0
  235. package/lib/osiris/ui/RiskFindings.d.ts.map +1 -0
  236. package/lib/osiris/ui/RiskFindings.js +51 -0
  237. package/lib/osiris/ui/RiskFindings.js.map +1 -0
  238. package/lib/osiris/ui/RiskPanel.d.ts +46 -0
  239. package/lib/osiris/ui/RiskPanel.d.ts.map +1 -0
  240. package/lib/osiris/ui/RiskPanel.js +32 -0
  241. package/lib/osiris/ui/RiskPanel.js.map +1 -0
  242. package/lib/osiris/ui/RiskSquare.d.ts +51 -0
  243. package/lib/osiris/ui/RiskSquare.d.ts.map +1 -0
  244. package/lib/osiris/ui/RiskSquare.js +23 -0
  245. package/lib/osiris/ui/RiskSquare.js.map +1 -0
  246. package/lib/osiris/ui/index.d.ts +15 -0
  247. package/lib/osiris/ui/index.d.ts.map +1 -0
  248. package/lib/osiris/ui/index.js +8 -0
  249. package/lib/osiris/ui/index.js.map +1 -0
  250. package/lib/osiris/ui/usePredictions.d.ts +81 -0
  251. package/lib/osiris/ui/usePredictions.d.ts.map +1 -0
  252. package/lib/osiris/ui/usePredictions.js +102 -0
  253. package/lib/osiris/ui/usePredictions.js.map +1 -0
  254. package/lib/osiris-ui.d.ts +11 -0
  255. package/lib/osiris-ui.d.ts.map +1 -0
  256. package/lib/osiris-ui.js +11 -0
  257. package/lib/osiris-ui.js.map +1 -0
  258. package/lib/osiris.d.ts +17 -0
  259. package/lib/osiris.d.ts.map +1 -0
  260. package/lib/osiris.js +17 -0
  261. package/lib/osiris.js.map +1 -0
  262. package/lib/panel/ui/FilterInput.d.ts.map +1 -1
  263. package/lib/panel/ui/FilterInput.js +3 -1
  264. package/lib/panel/ui/FilterInput.js.map +1 -1
  265. package/lib/panel/ui/SidePanelItem.d.ts +39 -0
  266. package/lib/panel/ui/SidePanelItem.d.ts.map +1 -0
  267. package/lib/panel/ui/SidePanelItem.js +63 -0
  268. package/lib/panel/ui/SidePanelItem.js.map +1 -0
  269. package/lib/panel/ui/SidePanelStack.d.ts +11 -10
  270. package/lib/panel/ui/SidePanelStack.d.ts.map +1 -1
  271. package/lib/panel/ui/SidePanelStack.js +22 -15
  272. package/lib/panel/ui/SidePanelStack.js.map +1 -1
  273. package/lib/panel/ui/SpectrumColorSwatch.d.ts.map +1 -1
  274. package/lib/panel/ui/SpectrumColorSwatch.js +4 -2
  275. package/lib/panel/ui/SpectrumColorSwatch.js.map +1 -1
  276. package/lib/panel/ui/usePanelFolds.d.ts +35 -0
  277. package/lib/panel/ui/usePanelFolds.d.ts.map +1 -0
  278. package/lib/panel/ui/usePanelFolds.js +73 -0
  279. package/lib/panel/ui/usePanelFolds.js.map +1 -0
  280. package/lib/shared/ui/FullscreenStage.d.ts +43 -0
  281. package/lib/shared/ui/FullscreenStage.d.ts.map +1 -0
  282. package/lib/shared/ui/FullscreenStage.js +38 -0
  283. package/lib/shared/ui/FullscreenStage.js.map +1 -0
  284. package/lib/shared/ui/canFillScreen.d.ts +7 -0
  285. package/lib/shared/ui/canFillScreen.d.ts.map +1 -0
  286. package/lib/shared/ui/canFillScreen.js +9 -0
  287. package/lib/shared/ui/canFillScreen.js.map +1 -0
  288. package/lib/shared/ui/index.d.ts +3 -0
  289. package/lib/shared/ui/index.d.ts.map +1 -1
  290. package/lib/shared/ui/index.js +2 -0
  291. package/lib/shared/ui/index.js.map +1 -1
  292. package/lib/split/ui/splitPanes.d.ts +3 -3
  293. package/lib/split/ui/splitPanes.js +1 -1
  294. package/lib/structure/core/structureNotations.d.ts +8 -1
  295. package/lib/structure/core/structureNotations.d.ts.map +1 -1
  296. package/lib/structure/core/structureNotations.js +14 -8
  297. package/lib/structure/core/structureNotations.js.map +1 -1
  298. package/lib/structure/ui/StructureExportPanel.d.ts +8 -0
  299. package/lib/structure/ui/StructureExportPanel.d.ts.map +1 -1
  300. package/lib/structure/ui/StructureExportPanel.js +9 -4
  301. package/lib/structure/ui/StructureExportPanel.js.map +1 -1
  302. package/lib/structure/ui/index.d.ts +1 -0
  303. package/lib/structure/ui/index.d.ts.map +1 -1
  304. package/lib/structure/ui/index.js.map +1 -1
  305. package/package.json +4 -1
  306. package/src/card/core/cardAddress.ts +39 -3
  307. package/src/card/core/cardPageUrl.ts +10 -3
  308. package/src/card/core/index.ts +7 -1
  309. package/src/credits/core/credits.ts +40 -0
  310. package/src/download/core/downloadFigure.ts +26 -1
  311. package/src/download/core/figureDpi.ts +94 -0
  312. package/src/download/core/figurePng.ts +11 -2
  313. package/src/download/core/index.ts +13 -1
  314. package/src/download/core/pngDpi.ts +84 -0
  315. package/src/download/ui/FigureDownloadPanel.tsx +41 -51
  316. package/src/download/ui/figureDownloadHint.ts +13 -0
  317. package/src/download/ui/figureDownloadOptions.ts +85 -0
  318. package/src/download/ui/resolutionChoices.ts +67 -0
  319. package/src/download/ui/useFigureActions.ts +24 -9
  320. package/src/download/ui/useFigureDownload.tsx +57 -71
  321. package/src/ecosystem/core/sites.ts +14 -0
  322. package/src/ecosystem/core/types.ts +2 -1
  323. package/src/ecosystem/ui/glyphs.tsx +20 -0
  324. package/src/host/core/connectHost.ts +1 -1
  325. package/src/host/core/connectTool.ts +285 -0
  326. package/src/host/core/hostOutputs.ts +47 -5
  327. package/src/host/core/index.ts +20 -1
  328. package/src/host/core/kinds.ts +53 -8
  329. package/src/host/core/messageValues.ts +58 -0
  330. package/src/host/core/protocol.ts +5 -37
  331. package/src/host/core/resultKinds.ts +65 -0
  332. package/src/host/core/toolMessages.ts +160 -0
  333. package/src/host/ui/index.ts +6 -0
  334. package/src/host/ui/useFramedTool.ts +213 -0
  335. package/src/locales/de.json +30 -1
  336. package/src/locales/en.json +30 -1
  337. package/src/locales/es.json +30 -1
  338. package/src/locales/fr.json +30 -1
  339. package/src/locales/it.json +30 -1
  340. package/src/molecule3d/ui/Molecule3DStage.tsx +4 -88
  341. package/src/molecule3d/ui/MoleculeCanvas3D.tsx +10 -1
  342. package/src/molecule3d/ui/exportMoleculeImage.ts +22 -0
  343. package/src/molecule3d/ui/index.ts +4 -1
  344. package/src/molecule3d/ui/moleculeViewer3DProps.ts +24 -0
  345. package/src/molecule3d/ui/useImageExport.ts +28 -2
  346. package/src/osiris/core/barGeometry.ts +74 -0
  347. package/src/osiris/core/computeProperties.ts +175 -0
  348. package/src/osiris/core/constants.ts +110 -0
  349. package/src/osiris/core/fitness.ts +59 -0
  350. package/src/osiris/core/index.ts +78 -0
  351. package/src/osiris/core/poolSize.ts +24 -0
  352. package/src/osiris/core/poolTypes.ts +140 -0
  353. package/src/osiris/core/predictIdCode.ts +69 -0
  354. package/src/osiris/core/predictProtocol.ts +78 -0
  355. package/src/osiris/core/predictionPool.ts +237 -0
  356. package/src/osiris/core/predictionQueue.ts +89 -0
  357. package/src/osiris/core/predictors.ts +142 -0
  358. package/src/osiris/core/propertyKeys.ts +54 -0
  359. package/src/osiris/core/riskAppearance.ts +86 -0
  360. package/src/osiris/core/riskDetail.ts +120 -0
  361. package/src/osiris/core/riskDetailRequest.ts +64 -0
  362. package/src/osiris/core/riskFindings.ts +92 -0
  363. package/src/osiris/core/runPredictionJob.ts +49 -0
  364. package/src/osiris/core/scales.ts +236 -0
  365. package/src/osiris/core/types.ts +103 -0
  366. package/src/osiris/core/valuation.ts +44 -0
  367. package/src/osiris/ui/PropertyBar.tsx +77 -0
  368. package/src/osiris/ui/PropertyPanel.tsx +227 -0
  369. package/src/osiris/ui/PropertyRows.tsx +92 -0
  370. package/src/osiris/ui/RiskFindings.tsx +137 -0
  371. package/src/osiris/ui/RiskPanel.tsx +81 -0
  372. package/src/osiris/ui/RiskSquare.tsx +108 -0
  373. package/src/osiris/ui/index.ts +17 -0
  374. package/src/osiris/ui/usePredictions.ts +194 -0
  375. package/src/osiris-ui.ts +11 -0
  376. package/src/osiris.ts +17 -0
  377. package/src/panel/ui/FilterInput.tsx +4 -1
  378. package/src/panel/ui/SidePanelItem.tsx +162 -0
  379. package/src/panel/ui/SidePanelStack.tsx +29 -36
  380. package/src/panel/ui/SpectrumColorSwatch.tsx +5 -3
  381. package/src/panel/ui/usePanelFolds.ts +103 -0
  382. package/src/shared/ui/FullscreenStage.tsx +96 -0
  383. package/src/shared/ui/canFillScreen.ts +8 -0
  384. package/src/shared/ui/index.ts +6 -0
  385. package/src/split/ui/splitPanes.tsx +4 -4
  386. package/src/structure/core/structureNotations.ts +25 -8
  387. package/src/structure/ui/StructureExportPanel.tsx +23 -4
  388. package/src/structure/ui/index.ts +4 -0
  389. package/styles/osiris.css +339 -0
@@ -0,0 +1,51 @@
1
+ /**
2
+ * One toxicity risk, as a coloured square with its name beside it.
3
+ *
4
+ * The square is a button whenever the page can explain it, because the
5
+ * explanation is the honest half of the colour: aspirin, caffeine and
6
+ * paracetamol come back red through the known-molecule branch, not through a
7
+ * toxicophore, and only opening it says so.
8
+ *
9
+ * `compact` drops the words and keeps the square, which is what a cell of the
10
+ * comparison table needs; the name and the level stay on the accessible label,
11
+ * so the cell is still readable to a screen reader and on hover.
12
+ */
13
+ import type { ReactElement } from 'react';
14
+ import type { RiskLevel, RiskType } from '../core/types.ts';
15
+ /** What {@link RiskSquare} needs. */
16
+ export interface RiskSquareProps {
17
+ /** Which of the four risks this shows. */
18
+ risk: RiskType;
19
+ /** How it came back, or `undefined` when it has not been assessed. */
20
+ level: RiskLevel | undefined;
21
+ /**
22
+ * Whether a prediction is running for this molecule. It is what tells an
23
+ * unassessed square to say it is working rather than that there is nothing
24
+ * to work on.
25
+ * @default false
26
+ */
27
+ pending?: boolean;
28
+ /**
29
+ * Whether this risk's explanation is the one open.
30
+ * @default false
31
+ */
32
+ selected?: boolean;
33
+ /**
34
+ * Called with the risk when the square is clicked. Without it the square is
35
+ * not a button.
36
+ * @default undefined
37
+ */
38
+ onSelect?: (risk: RiskType) => void;
39
+ /**
40
+ * Draw the square alone, for a cell of a table.
41
+ * @default false
42
+ */
43
+ compact?: boolean;
44
+ }
45
+ /**
46
+ * One risk's square.
47
+ * @param props - See {@link RiskSquareProps}.
48
+ * @returns The square, as a button when the page can explain it.
49
+ */
50
+ export declare function RiskSquare(props: RiskSquareProps): ReactElement;
51
+ //# sourceMappingURL=RiskSquare.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RiskSquare.d.ts","sourceRoot":"","sources":["../../../src/osiris/ui/RiskSquare.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAI1C,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5D,qCAAqC;AACrC,MAAM,WAAW,eAAe;IAC9B,0CAA0C;IAC1C,IAAI,EAAE,QAAQ,CAAC;IACf,sEAAsE;IACtE,KAAK,EAAE,SAAS,GAAG,SAAS,CAAC;IAC7B;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IACpC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,YAAY,CAoD/D"}
@@ -0,0 +1,23 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { RISK_LABELS } from "../core/constants.js";
3
+ import { riskAppearance } from "../core/riskAppearance.js";
4
+ /**
5
+ * One risk's square.
6
+ * @param props - See {@link RiskSquareProps}.
7
+ * @returns The square, as a button when the page can explain it.
8
+ */
9
+ export function RiskSquare(props) {
10
+ const { risk, level, pending = false, selected = false, onSelect, compact = false, } = props;
11
+ const { tone, label, explainable } = riskAppearance(level, pending);
12
+ const name = RISK_LABELS[risk];
13
+ const description = `${name}: ${label}`;
14
+ const clickable = onSelect !== undefined && explainable;
15
+ const body = (_jsxs(_Fragment, { children: [_jsx("span", { className: "risk-square__swatch", "data-level": tone }), compact ? null : (_jsxs("span", { className: "risk-square__text", children: [_jsx("span", { className: "risk-square__name", children: name }), _jsx("span", { className: "risk-square__level", children: label })] }))] }));
16
+ if (!clickable) {
17
+ return (_jsx("span", { className: compact ? 'risk-square risk-square--compact' : 'risk-square', title: description, "aria-label": compact ? description : undefined, children: body }));
18
+ }
19
+ return (_jsx("button", { type: "button", className: compact ? 'risk-square risk-square--compact' : 'risk-square', title: `${description} — why?`, "aria-label": compact ? description : undefined, "aria-pressed": selected, onClick: () => {
20
+ onSelect(risk);
21
+ }, children: body }));
22
+ }
23
+ //# sourceMappingURL=RiskSquare.js.map
@@ -0,0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,CACL,iBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC,kCAAkC,CAAC,CAAC,CAAC,aAAa,EACvE,KAAK,EAAE,GAAG,WAAW,SAAS,gBAClB,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,kBAC/B,QAAQ,EACtB,OAAO,EAAE,GAAG,EAAE;YACZ,QAAQ,CAAC,IAAI,CAAC,CAAC;QACjB,CAAC,YAEA,IAAI,GACE,CACV,CAAC;AACJ,CAAC"}
@@ -0,0 +1,15 @@
1
+ export type { PropertyBarProps } from './PropertyBar.tsx';
2
+ export { PropertyBar } from './PropertyBar.tsx';
3
+ export type { PropertyPanelProps } from './PropertyPanel.tsx';
4
+ export { PropertyPanel } from './PropertyPanel.tsx';
5
+ export type { PropertyRowsProps } from './PropertyRows.tsx';
6
+ export { PropertyRows } from './PropertyRows.tsx';
7
+ export type { RiskFindingsProps } from './RiskFindings.tsx';
8
+ export { RiskFindings } from './RiskFindings.tsx';
9
+ export type { RiskPanelProps } from './RiskPanel.tsx';
10
+ export { RiskPanel } from './RiskPanel.tsx';
11
+ export type { RiskSquareProps } from './RiskSquare.tsx';
12
+ export { RiskSquare } from './RiskSquare.tsx';
13
+ export type { UsePredictionsOptions, UsePredictionsResult, } from './usePredictions.ts';
14
+ export { usePredictions } from './usePredictions.ts';
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/osiris/ui/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,YAAY,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,YAAY,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,YAAY,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,YAAY,EACV,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,8 @@
1
+ export { PropertyBar } from "./PropertyBar.js";
2
+ export { PropertyPanel } from "./PropertyPanel.js";
3
+ export { PropertyRows } from "./PropertyRows.js";
4
+ export { RiskFindings } from "./RiskFindings.js";
5
+ export { RiskPanel } from "./RiskPanel.js";
6
+ export { RiskSquare } from "./RiskSquare.js";
7
+ export { usePredictions } from "./usePredictions.js";
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/osiris/ui/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAmB,CAAC;AAEhD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAqB,CAAC;AAEpD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAoB,CAAC;AAElD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAoB,CAAC;AAElD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAiB,CAAC;AAE5C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAkB,CAAC;AAK9C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,81 @@
1
+ /**
2
+ * The prediction pool, handed to a page.
3
+ *
4
+ * The only React in the domain. Results arrive one at a time and are kept in a
5
+ * map the page reads by row key, so a table draws every row immediately and
6
+ * fills each one in as its worker answers — nothing waits for the set.
7
+ *
8
+ * The two maps are created once and mutated, and a counter beside them changes
9
+ * to say so. Building a new map per answer would copy a growing map once per
10
+ * molecule, which on a set of two thousand costs more than the predictions do.
11
+ */
12
+ import type { WorkerLike } from '../../worker/core/messages.ts';
13
+ import type { PredictionInput, PredictionProgress } from '../core/poolTypes.ts';
14
+ import type { ResourceSource } from '../core/predictors.ts';
15
+ import type { OsirisProperties, RiskDetail, RiskType } from '../core/types.ts';
16
+ /** What a page gives the hook. */
17
+ export interface UsePredictionsOptions {
18
+ /**
19
+ * The molecules to predict. One already answered is never asked for again,
20
+ * so a page may pass its whole set on every render — though memoising it
21
+ * saves the filtering pass.
22
+ */
23
+ molecules: readonly PredictionInput[];
24
+ /**
25
+ * The keys of the rows the reader can see, most wanted first. They are
26
+ * answered before the rest.
27
+ * @default undefined — the reading order is kept
28
+ */
29
+ visibleKeys?: readonly string[];
30
+ /**
31
+ * Whether to predict at all. Off while a file is still being read, so the
32
+ * pool is not asked for half a set.
33
+ * @default true
34
+ */
35
+ enabled?: boolean;
36
+ /**
37
+ * Where the workers register OpenChemLib's resources from: the absolute URL
38
+ * of the site's own `openchemlib-resources.json`, resolved on the main thread
39
+ * — a worker has no `document` to read the deployment's mount path off, and
40
+ * a relative address would resolve against its hashed chunk.
41
+ */
42
+ resources: ResourceSource;
43
+ /**
44
+ * Makes one prediction worker: a module worker of the site's own, serving
45
+ * `runPredictionJob` for the requests `isPredictRequest` accepts. It may be
46
+ * a new function on every render — it is read only when a worker is made.
47
+ */
48
+ createWorker: () => WorkerLike;
49
+ /**
50
+ * How many workers to run.
51
+ * @default one fewer than the machine's cores, clamped to 1 to 8
52
+ */
53
+ size?: number;
54
+ }
55
+ /** What the hook gives a page back. */
56
+ export interface UsePredictionsResult {
57
+ /** What each answered row was predicted to be, by row key. */
58
+ results: ReadonlyMap<string, OsirisProperties>;
59
+ /** Why each refused row was refused, by row key. */
60
+ failures: ReadonlyMap<string, string>;
61
+ /** How far the pool has got. */
62
+ progress: PredictionProgress;
63
+ /** Why no prediction can be made at all, or `null`. */
64
+ error: string | null;
65
+ /** Drop everything still queued. */
66
+ cancel: () => void;
67
+ /**
68
+ * Why one risk came back as it did.
69
+ * @param idCode - The molecule, coordinates included or not.
70
+ * @param risk - Which of the four risks to explain.
71
+ * @returns The findings, with the matched atoms and bonds of every fragment.
72
+ */
73
+ riskDetail: (idCode: string, risk: RiskType) => Promise<RiskDetail>;
74
+ }
75
+ /**
76
+ * Predict a set of molecules on a pool of workers, streaming the answers back.
77
+ * @param options - See {@link UsePredictionsOptions}.
78
+ * @returns The answers so far, the progress, and the controls.
79
+ */
80
+ export declare function usePredictions(options: UsePredictionsOptions): UsePredictionsResult;
81
+ //# sourceMappingURL=usePredictions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePredictions.d.ts","sourceRoot":"","sources":["../../../src/osiris/ui/usePredictions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,KAAK,EACV,eAAe,EAEf,kBAAkB,EACnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE/E,kCAAkC;AAClC,MAAM,WAAW,qBAAqB;IACpC;;;;OAIG;IACH,SAAS,EAAE,SAAS,eAAe,EAAE,CAAC;IACtC;;;;OAIG;IACH,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;OAKG;IACH,SAAS,EAAE,cAAc,CAAC;IAC1B;;;;OAIG;IACH,YAAY,EAAE,MAAM,UAAU,CAAC;IAC/B;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,uCAAuC;AACvC,MAAM,WAAW,oBAAoB;IACnC,8DAA8D;IAC9D,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC/C,oDAAoD;IACpD,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,gCAAgC;IAChC,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,uDAAuD;IACvD,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,oCAAoC;IACpC,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB;;;;;OAKG;IACH,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;CACrE;AAoBD;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,qBAAqB,GAC7B,oBAAoB,CAmFtB"}
@@ -0,0 +1,102 @@
1
+ /**
2
+ * The prediction pool, handed to a page.
3
+ *
4
+ * The only React in the domain. Results arrive one at a time and are kept in a
5
+ * map the page reads by row key, so a table draws every row immediately and
6
+ * fills each one in as its worker answers — nothing waits for the set.
7
+ *
8
+ * The two maps are created once and mutated, and a counter beside them changes
9
+ * to say so. Building a new map per answer would copy a growing map once per
10
+ * molecule, which on a set of two thousand costs more than the predictions do.
11
+ */
12
+ import { useCallback, useEffect, useRef, useState } from 'react';
13
+ import { createPredictionPool } from "../core/predictionPool.js";
14
+ const IDLE = {
15
+ done: 0,
16
+ total: 0,
17
+ pending: 0,
18
+ running: false,
19
+ };
20
+ /**
21
+ * Predict a set of molecules on a pool of workers, streaming the answers back.
22
+ * @param options - See {@link UsePredictionsOptions}.
23
+ * @returns The answers so far, the progress, and the controls.
24
+ */
25
+ export function usePredictions(options) {
26
+ const { molecules, visibleKeys, enabled = true, size } = options;
27
+ const { resources, createWorker } = options;
28
+ // Read when the pool and its workers are made rather than listed as a
29
+ // dependency: a factory written inline is a new function on every render,
30
+ // and the progress the pool reports causes one.
31
+ const source = useRef({ resources, createWorker });
32
+ useEffect(() => {
33
+ source.current = { resources, createWorker };
34
+ }, [resources, createWorker]);
35
+ const [answered] = useState(() => ({
36
+ results: new Map(),
37
+ failures: new Map(),
38
+ }));
39
+ const [view, setView] = useState({
40
+ progress: IDLE,
41
+ error: null,
42
+ answers: 0,
43
+ });
44
+ const pool = useRef(null);
45
+ const open = useCallback(() => {
46
+ pool.current ??= createPredictionPool({
47
+ resources: source.current.resources,
48
+ createWorker: () => source.current.createWorker(),
49
+ ...(size === undefined ? {} : { size }),
50
+ onResult(outcome) {
51
+ if (outcome.ok)
52
+ answered.results.set(outcome.key, outcome.properties);
53
+ else
54
+ answered.failures.set(outcome.key, outcome.message);
55
+ setView((previous) => ({ ...previous, answers: previous.answers + 1 }));
56
+ },
57
+ onProgress(progress) {
58
+ setView((previous) => ({ ...previous, progress }));
59
+ },
60
+ onUnavailable(message) {
61
+ setView((previous) => ({ ...previous, error: message }));
62
+ },
63
+ });
64
+ return pool.current;
65
+ }, [answered, size]);
66
+ const unavailable = view.error;
67
+ useEffect(() => {
68
+ if (!enabled || unavailable !== null)
69
+ return;
70
+ const waiting = [];
71
+ for (const molecule of molecules) {
72
+ if (answered.results.has(molecule.key))
73
+ continue;
74
+ if (answered.failures.has(molecule.key))
75
+ continue;
76
+ waiting.push(molecule);
77
+ }
78
+ if (waiting.length > 0)
79
+ open().submit(waiting);
80
+ }, [answered, molecules, enabled, open, unavailable]);
81
+ useEffect(() => {
82
+ if (visibleKeys !== undefined)
83
+ pool.current?.prioritize(visibleKeys);
84
+ }, [visibleKeys]);
85
+ useEffect(() => () => {
86
+ pool.current?.terminate();
87
+ pool.current = null;
88
+ }, []);
89
+ const cancel = useCallback(() => {
90
+ pool.current?.cancel();
91
+ }, []);
92
+ const riskDetail = useCallback((idCode, risk) => open().riskDetail(idCode, risk), [open]);
93
+ return {
94
+ results: answered.results,
95
+ failures: answered.failures,
96
+ progress: view.progress,
97
+ error: view.error,
98
+ cancel,
99
+ riskDetail,
100
+ };
101
+ }
102
+ //# sourceMappingURL=usePredictions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePredictions.js","sourceRoot":"","sources":["../../../src/osiris/ui/usePredictions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAQjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAiEjE,MAAM,IAAI,GAAuB;IAC/B,IAAI,EAAE,CAAC;IACP,KAAK,EAAE,CAAC;IACR,OAAO,EAAE,CAAC;IACV,OAAO,EAAE,KAAK;CACf,CAAC;AAaF;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAC5B,OAA8B;IAE9B,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,GAAG,IAAI,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IACjE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC;IAC5C,sEAAsE;IACtE,0EAA0E;IAC1E,gDAAgD;IAChD,MAAM,MAAM,GAAG,MAAM,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC,CAAC;IACnD,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,CAAC,OAAO,GAAG,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;IAC/C,CAAC,EAAE,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC;IAE9B,MAAM,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAW,GAAG,EAAE,CAAC,CAAC;QAC3C,OAAO,EAAE,IAAI,GAAG,EAAE;QAClB,QAAQ,EAAE,IAAI,GAAG,EAAE;KACpB,CAAC,CAAC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ACzB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,UAAU,GAAG,WAAW,CAC5B,CAAC,MAAc,EAAE,IAAc,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,EACnE,CAAC,IAAI,CAAC,CACP,CAAC;IAEF,OAAO;QACL,OAAO,EAAE,QAAQ,CAAC,OAAO;QACzB,QAAQ,EAAE,QAAQ,CAAC,QAAQ;QAC3B,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,MAAM;QACN,UAAU;KACX,CAAC;AACJ,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * The OSIRIS property panel — the four risk squares, the ten bars and the
3
+ * explanation a square opens — and `usePredictions`, which drives a pool of
4
+ * prediction workers from a page.
5
+ *
6
+ * Kept apart from `react-cheminfo/osiris` so the worker that predicts loads no
7
+ * React and no Blueprint; everything the panel draws from is imported from
8
+ * there. The stylesheet is `react-cheminfo/styles/osiris.css`.
9
+ */
10
+ export * from './osiris/ui/index.ts';
11
+ //# sourceMappingURL=osiris-ui.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"osiris-ui.d.ts","sourceRoot":"","sources":["../src/osiris-ui.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,cAAc,sBAAsB,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * The OSIRIS property panel — the four risk squares, the ten bars and the
3
+ * explanation a square opens — and `usePredictions`, which drives a pool of
4
+ * prediction workers from a page.
5
+ *
6
+ * Kept apart from `react-cheminfo/osiris` so the worker that predicts loads no
7
+ * React and no Blueprint; everything the panel draws from is imported from
8
+ * there. The stylesheet is `react-cheminfo/styles/osiris.css`.
9
+ */
10
+ export * from "./osiris/ui/index.js";
11
+ //# sourceMappingURL=osiris-ui.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"osiris-ui.js","sourceRoot":"","sources":["../src/osiris-ui.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,cAAc,sBAAsB,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * What OSIRIS predicts about a molecule — the four toxicity risks, cLogP,
3
+ * solubility, drug-likeness and the drug score — and the pool of workers that
4
+ * predicts a whole set of them.
5
+ *
6
+ * Framework-free on purpose, and its own door for two reasons. A prediction
7
+ * worker imports `runPredictionJob` and `isPredictRequest` from here, and a dev
8
+ * server hands a worker its dependencies unbundled, so anything React-shaped
9
+ * behind this door would be evaluated in every worker. And a server answering
10
+ * predictions over an API loads it in Node, where nothing is tree-shaken.
11
+ * `openchemlib` is imported on the first prediction, never on import.
12
+ *
13
+ * The panel that draws the answer, and the hook that drives the pool from a
14
+ * page, are `react-cheminfo/osiris-ui`.
15
+ */
16
+ export * from './osiris/core/index.ts';
17
+ //# sourceMappingURL=osiris.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"osiris.d.ts","sourceRoot":"","sources":["../src/osiris.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,wBAAwB,CAAC"}
package/lib/osiris.js ADDED
@@ -0,0 +1,17 @@
1
+ /**
2
+ * What OSIRIS predicts about a molecule — the four toxicity risks, cLogP,
3
+ * solubility, drug-likeness and the drug score — and the pool of workers that
4
+ * predicts a whole set of them.
5
+ *
6
+ * Framework-free on purpose, and its own door for two reasons. A prediction
7
+ * worker imports `runPredictionJob` and `isPredictRequest` from here, and a dev
8
+ * server hands a worker its dependencies unbundled, so anything React-shaped
9
+ * behind this door would be evaluated in every worker. And a server answering
10
+ * predictions over an API loads it in Node, where nothing is tree-shaken.
11
+ * `openchemlib` is imported on the first prediction, never on import.
12
+ *
13
+ * The panel that draws the answer, and the hook that drives the pool from a
14
+ * page, are `react-cheminfo/osiris-ui`.
15
+ */
16
+ export * from "./osiris/core/index.js";
17
+ //# sourceMappingURL=osiris.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"osiris.js","sourceRoot":"","sources":["../src/osiris.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,wBAAwB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"FilterInput.d.ts","sourceRoot":"","sources":["../../../src/panel/ui/FilterInput.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,gBAAgB;IAC/B,2BAA2B;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,gFAAgF;IAChF,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,2CAA2C;IAC3C,WAAW,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,+BAyBlD"}
1
+ {"version":3,"file":"FilterInput.d.ts","sourceRoot":"","sources":["../../../src/panel/ui/FilterInput.tsx"],"names":[],"mappings":"AAMA,MAAM,WAAW,gBAAgB;IAC/B,2BAA2B;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,gFAAgF;IAChF,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,2CAA2C;IAC3C,WAAW,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,+BA0BlD"}
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { InputGroup } from '@blueprintjs/core';
3
+ import { useChromeT } from "../../i18n/ui/useT.js";
3
4
  import { ClearButton } from "./ClearButton.js";
4
5
  /**
5
6
  * The box a list is filtered through, with a cross to empty it again.
@@ -18,6 +19,7 @@ import { ClearButton } from "./ClearButton.js";
18
19
  */
19
20
  export function FilterInput(props) {
20
21
  const { value, onValueChange, placeholder, autoFocus = false } = props;
21
- return (_jsx(InputGroup, { autoFocus: autoFocus, leftIcon: "search", size: "small", value: value, placeholder: placeholder, spellCheck: false, autoCapitalize: "off", autoCorrect: "off", autoComplete: "off", rightElement: value.length > 0 ? (_jsx(ClearButton, { label: "Clear the filter", onClick: () => onValueChange('') })) : undefined, onValueChange: onValueChange }));
22
+ const t = useChromeT();
23
+ return (_jsx(InputGroup, { autoFocus: autoFocus, leftIcon: "search", size: "small", value: value, placeholder: placeholder, spellCheck: false, autoCapitalize: "off", autoCorrect: "off", autoComplete: "off", rightElement: value.length > 0 ? (_jsx(ClearButton, { label: t('panel.clearFilter'), onClick: () => onValueChange('') })) : undefined, onValueChange: onValueChange }));
22
24
  }
23
25
  //# sourceMappingURL=FilterInput.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FilterInput.js","sourceRoot":"","sources":["../../../src/panel/ui/FilterInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAmB,CAAC;AAiBhD;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,WAAW,CAAC,KAAuB;IACjD,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS,GAAG,KAAK,EAAE,GAAG,KAAK,CAAC;IAEvE,OAAO,CACL,KAAC,UAAU,IACT,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAC,QAAQ,EACjB,IAAI,EAAC,OAAO,EACZ,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,KAAK,EACjB,cAAc,EAAC,KAAK,EACpB,WAAW,EAAC,KAAK,EACjB,YAAY,EAAC,KAAK,EAClB,YAAY,EACV,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CACjB,KAAC,WAAW,IACV,KAAK,EAAC,kBAAkB,EACxB,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,EAAE,CAAC,GAChC,CACH,CAAC,CAAC,CAAC,SAAS,EAEf,aAAa,EAAE,aAAa,GAC5B,CACH,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"FilterInput.js","sourceRoot":"","sources":["../../../src/panel/ui/FilterInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAmB,CAAC;AAiBhD;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,WAAW,CAAC,KAAuB;IACjD,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS,GAAG,KAAK,EAAE,GAAG,KAAK,CAAC;IACvE,MAAM,CAAC,GAAG,UAAU,EAAE,CAAC;IAEvB,OAAO,CACL,KAAC,UAAU,IACT,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAC,QAAQ,EACjB,IAAI,EAAC,OAAO,EACZ,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,KAAK,EACjB,cAAc,EAAC,KAAK,EACpB,WAAW,EAAC,KAAK,EACjB,YAAY,EAAC,KAAK,EAClB,YAAY,EACV,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CACjB,KAAC,WAAW,IACV,KAAK,EAAE,CAAC,CAAC,mBAAmB,CAAC,EAC7B,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,EAAE,CAAC,GAChC,CACH,CAAC,CAAC,CAAC,SAAS,EAEf,aAAa,EAAE,aAAa,GAC5B,CACH,CAAC;AACJ,CAAC"}
@@ -0,0 +1,39 @@
1
+ import type { ReactNode } from 'react';
2
+ /** Props of {@link SidePanelItem}. */
3
+ export interface SidePanelItemProps {
4
+ /** Identity of the panel in the stack. */
5
+ id: string;
6
+ /** What the header says. */
7
+ title: string;
8
+ /** Whether the panel shows its body. */
9
+ isOpen: boolean;
10
+ /**
11
+ * Called when the chevron, the header or a shift-click on another header
12
+ * folds or unfolds the panel.
13
+ * @param isOpen - Whether it shows its body.
14
+ */
15
+ onOpenChange: (isOpen: boolean) => void;
16
+ /**
17
+ * Whether the panel is the one in focus, and the toggle; `undefined` while it
18
+ * is alone in the stack, where there is nothing to fold.
19
+ */
20
+ focus: {
21
+ active: boolean;
22
+ toggle: () => void;
23
+ } | undefined;
24
+ /** Called when the close cross is pressed. */
25
+ onClose: () => void;
26
+ /** The body. */
27
+ children: ReactNode;
28
+ }
29
+ /**
30
+ * One panel of the stack: the header with the shell's gestures, and the body,
31
+ * which is also the box that fills the screen.
32
+ *
33
+ * The header is not part of what fills the screen, so a body that does carries
34
+ * a bar of its own with the title and the way back.
35
+ * @param props - See {@link SidePanelItemProps}.
36
+ * @returns The accordion item.
37
+ */
38
+ export declare function SidePanelItem(props: SidePanelItemProps): import("react").JSX.Element;
39
+ //# sourceMappingURL=SidePanelItem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SidePanelItem.d.ts","sourceRoot":"","sources":["../../../src/panel/ui/SidePanelItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAC;AAYtD,sCAAsC;AACtC,MAAM,WAAW,kBAAkB;IACjC,0CAA0C;IAC1C,EAAE,EAAE,MAAM,CAAC;IACX,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,MAAM,EAAE,OAAO,CAAC;IAChB;;;;OAIG;IACH,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC;;;OAGG;IACH,KAAK,EAAE;QAAE,MAAM,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,IAAI,CAAA;KAAE,GAAG,SAAS,CAAC;IAC3D,8CAA8C;IAC9C,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,gBAAgB;IAChB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,+BAwFtD"}
@@ -0,0 +1,63 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useCallback, useRef, useState } from 'react';
3
+ import { Accordion, Button } from 'react-science/ui';
4
+ import { useLanguage } from "../../i18n/ui/useLanguage.js";
5
+ import { useChromeT } from "../../i18n/ui/useT.js";
6
+ import { FullscreenStage } from "../../shared/ui/FullscreenStage.js";
7
+ import { canFillScreen } from "../../shared/ui/canFillScreen.js";
8
+ import { TOKEN } from "../../tokens/core/familyTokens.js";
9
+ import { panelStyle, panelToolbarStyle } from "../core/panelStyles.js";
10
+ /**
11
+ * One panel of the stack: the header with the shell's gestures, and the body,
12
+ * which is also the box that fills the screen.
13
+ *
14
+ * The header is not part of what fills the screen, so a body that does carries
15
+ * a bar of its own with the title and the way back.
16
+ * @param props - See {@link SidePanelItemProps}.
17
+ * @returns The accordion item.
18
+ */
19
+ export function SidePanelItem(props) {
20
+ const { id, title, isOpen, onOpenChange, focus, onClose, children } = props;
21
+ const t = useChromeT();
22
+ const panel = inSentence(title, useLanguage());
23
+ const [canFill] = useState(canFillScreen);
24
+ const body = useRef(null);
25
+ const onStage = useCallback((element) => {
26
+ body.current = element;
27
+ }, []);
28
+ function fillScreen() {
29
+ if (!isOpen)
30
+ onOpenChange(true);
31
+ void body.current?.requestFullscreen().catch(() => undefined);
32
+ }
33
+ return (_jsx(Accordion.Item, { id: id, title: title, open: isOpen, onOpenChange: onOpenChange, renderToolbar: () => (_jsxs(_Fragment, { children: [focus !== undefined && (_jsx(Button, { variant: "minimal", icon: focus.active ? 'expand-all' : 'collapse-all', "aria-pressed": focus.active, "aria-label": t('panel.focus', { panel }), tooltipProps: {
34
+ content: focus.active
35
+ ? t('panel.unfocusTooltip')
36
+ : t('panel.focusTooltip'),
37
+ }, onClick: focus.toggle })), canFill && (_jsx(Button, { variant: "minimal", icon: "fullscreen", "aria-label": t('panel.fillScreen', { panel }), tooltipProps: { content: t('panel.fillScreenTooltip') }, onClick: fillScreen })), _jsx(Button, { variant: "minimal", icon: isOpen ? 'chevron-down' : 'chevron-right', "data-panel-open": isOpen, "aria-expanded": isOpen, "aria-label": t(isOpen ? 'panel.fold' : 'panel.unfold', { panel }), tooltipProps: {
38
+ content: t(isOpen ? 'panel.foldTooltip' : 'panel.unfoldTooltip'),
39
+ }, onClick: () => onOpenChange(!isOpen) }), _jsx(Button, { variant: "minimal", icon: "cross", tooltipProps: { content: t('panel.closeTooltip') }, "aria-label": t('panel.close', { panel }), onClick: onClose })] })), children: _jsx(FullscreenStage, { style: bodyStyle, onStage: onStage, children: (fullscreen) => (_jsxs(_Fragment, { children: [fullscreen?.active === true && (_jsxs("div", { style: fullscreenBarStyle, children: [_jsx("span", { style: fullscreenTitleStyle, children: title }), _jsx(Button, { variant: "minimal", icon: "minimize", "aria-label": t('panel.leaveFullScreen'), tooltipProps: { content: t('panel.leaveFullScreenTooltip') }, onClick: fullscreen.toggle })] })), children] })) }) }));
40
+ }
41
+ /**
42
+ * The title as it reads inside a sentence: lowercased, except in German, where
43
+ * every noun keeps its capital.
44
+ * @param title - The panel's title.
45
+ * @param language - The language of the sentence.
46
+ * @returns The title to write into it.
47
+ */
48
+ function inSentence(title, language) {
49
+ return language === 'de' ? title : title.toLocaleLowerCase(language);
50
+ }
51
+ /** A box filling the screen shows the backdrop through it unless painted. */
52
+ const filledStyle = { ...panelStyle, background: TOKEN.surface };
53
+ function bodyStyle(fillsScreen) {
54
+ return fillsScreen ? filledStyle : panelStyle;
55
+ }
56
+ const fullscreenBarStyle = {
57
+ ...panelToolbarStyle,
58
+ alignItems: 'center',
59
+ justifyContent: 'space-between',
60
+ paddingLeft: 12,
61
+ };
62
+ const fullscreenTitleStyle = { fontWeight: 'bold' };
63
+ //# s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;IACrC,OAAO,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,UAAU,CAAC;AAChD,CAAC;AAED,MAAM,kBAAkB,GAAkB;IACxC,GAAG,iBAAiB;IACpB,UAAU,EAAE,QAAQ;IACpB,cAAc,EAAE,eAAe;IAC/B,WAAW,EAAE,EAAE;CAChB,CAAC;AAEF,MAAM,oBAAoB,GAAkB,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC"}
@@ -40,21 +40,22 @@ export interface SidePanelStackProps<TPanel extends PanelDescriptor> {
40
40
  * They are drawn in the order the rail stacks their icons rather than the order
41
41
  * they were switched on, so a panel always comes back where it was.
42
42
  *
43
- * The header carries the shell's own two gestures and nothing about what the
44
- * panel holds: the chevron that folds it away and the cross that closes it.
45
- * What a panel switches on and off is a toolbar at the top of its own body, so
46
- * it travels with the panel when it is folded, reordered or lent to another
47
- * editor, and every header in every editor reads the same — which is the reason
48
- * this is one component rather than one per editor.
43
+ * The header carries the shell's own gestures and nothing about what the panel
44
+ * holds: focus, which folds every other panel away and unfolds them again;
45
+ * filling the screen with the panel, where the browser can; the chevron that
46
+ * folds it away; and the cross that closes it. What a panel switches on and off
47
+ * is a toolbar at the top of its own body, so it travels with the panel when it
48
+ * is folded, reordered or lent to another editor, and every header in every
49
+ * editor reads the same — which is the reason this is one component rather
50
+ * than one per editor.
49
51
  *
50
52
  * The chevron is there because nothing else says which panels are folded. The
51
53
  * accordion draws every header identically and hides only the body, so a side
52
54
  * of four closed panels and a side of four open ones differ by white space, and
53
55
  * a reader looking for a panel that is already open reaches for its icon and
54
- * closes it. It is a real button rather than a glyph because the header's own
55
- * click never reaches the toolbar — clicks there are stopped so the close cross
56
- * does not also fold the panel — so a chevron that did nothing when pressed
57
- * would be an affordance that lies.
56
+ * closes it. Focus is a button as well as a shift-click because a modifier on a
57
+ * header is a gesture nobody finds, and it undoes itself, which a shift-click
58
+ * does not.
58
59
  * @param props - Component props.
59
60
  * @returns The stack.
60
61
  */
@@ -1 +1 @@
1
- {"version":3,"file":"SidePanelStack.d.ts","sourceRoot":"","sources":["../../../src/panel/ui/SidePanelStack.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAG7D,sEAAsE;AACtE,MAAM,WAAW,eAAe;IAC9B,4EAA4E;IAC5E,EAAE,EAAE,MAAM,CAAC;IACX,+DAA+D;IAC/D,KAAK,EAAE,MAAM,CAAC;IACd,oCAAoC;IACpC,IAAI,EAAE,oBAAoB,CAAC,MAAM,CAAC,CAAC;CACpC;AAED,MAAM,WAAW,mBAAmB,CAAC,MAAM,SAAS,eAAe;IACjE,kEAAkE;IAClE,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B,0EAA0E;IAC1E,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC;;;;;OAKG;IACH,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;IACpC;;;;OAIG;IACH,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,SAAS,CAAC;CACxC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,cAAc,CAAC,MAAM,SAAS,eAAe,EAC3D,KAAK,EAAE,mBAAmB,CAAC,MAAM,CAAC,+BA2CnC"}
1
+ {"version":3,"file":"SidePanelStack.d.ts","sourceRoot":"","sources":["../../../src/panel/ui/SidePanelStack.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAM7D,sEAAsE;AACtE,MAAM,WAAW,eAAe;IAC9B,4EAA4E;IAC5E,EAAE,EAAE,MAAM,CAAC;IACX,+DAA+D;IAC/D,KAAK,EAAE,MAAM,CAAC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