@jbrowse/core 3.6.5 → 4.0.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 (940) hide show
  1. package/esm/BaseFeatureWidget/BaseFeatureDetail/ArrayValue.js +32 -0
  2. package/esm/BaseFeatureWidget/BaseFeatureDetail/Attributes.d.ts +13 -0
  3. package/esm/BaseFeatureWidget/BaseFeatureDetail/Attributes.js +43 -0
  4. package/esm/BaseFeatureWidget/BaseFeatureDetail/BaseAttributes.d.ts +8 -0
  5. package/esm/BaseFeatureWidget/BaseFeatureDetail/BaseAttributes.js +7 -0
  6. package/esm/BaseFeatureWidget/BaseFeatureDetail/BaseCard.d.ts +2 -0
  7. package/esm/BaseFeatureWidget/BaseFeatureDetail/BaseCard.js +17 -0
  8. package/esm/BaseFeatureWidget/BaseFeatureDetail/BaseCoreDetails.d.ts +2 -0
  9. package/esm/BaseFeatureWidget/BaseFeatureDetail/BaseCoreDetails.js +7 -0
  10. package/esm/BaseFeatureWidget/BaseFeatureDetail/BasicValue.js +20 -0
  11. package/esm/BaseFeatureWidget/BaseFeatureDetail/CoreDetails.d.ts +2 -0
  12. package/esm/BaseFeatureWidget/BaseFeatureDetail/CoreDetails.js +24 -0
  13. package/esm/BaseFeatureWidget/BaseFeatureDetail/DataGridDetails.js +57 -0
  14. package/esm/BaseFeatureWidget/BaseFeatureDetail/FeatureDetails.d.ts +11 -0
  15. package/esm/BaseFeatureWidget/BaseFeatureDetail/FeatureDetails.js +42 -0
  16. package/esm/BaseFeatureWidget/BaseFeatureDetail/FieldName.js +24 -0
  17. package/esm/BaseFeatureWidget/BaseFeatureDetail/Position.d.ts +2 -0
  18. package/esm/BaseFeatureWidget/BaseFeatureDetail/Position.js +14 -0
  19. package/esm/BaseFeatureWidget/BaseFeatureDetail/SimpleField.js +14 -0
  20. package/esm/BaseFeatureWidget/BaseFeatureDetail/UriField.js +22 -0
  21. package/esm/BaseFeatureWidget/BaseFeatureDetail/index.d.ts +7 -0
  22. package/esm/BaseFeatureWidget/BaseFeatureDetail/index.js +24 -0
  23. package/esm/BaseFeatureWidget/BaseFeatureDetail/types.d.ts +7 -0
  24. package/esm/BaseFeatureWidget/BaseFeatureDetail/types.js +1 -0
  25. package/esm/BaseFeatureWidget/BaseFeatureDetail/util.js +26 -0
  26. package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequenceContents.d.ts +10 -0
  27. package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequenceContents.js +41 -0
  28. package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeatureDetails.d.ts +7 -0
  29. package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeatureDetails.js +44 -0
  30. package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeaturePanel.d.ts +7 -0
  31. package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeaturePanel.js +34 -0
  32. package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequenceName.d.ts +8 -0
  33. package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequenceName.js +26 -0
  34. package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequencePanel.d.ts +3 -0
  35. package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequencePanel.js +29 -0
  36. package/esm/BaseFeatureWidget/SequenceFeatureDetails/consts.d.ts +6 -0
  37. package/esm/BaseFeatureWidget/SequenceFeatureDetails/consts.js +6 -0
  38. package/esm/BaseFeatureWidget/SequenceFeatureDetails/dialogs/HelpDialog.js +11 -0
  39. package/esm/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceDialog.d.ts +8 -0
  40. package/esm/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceDialog.js +40 -0
  41. package/esm/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceFeatureMenu.d.ts +8 -0
  42. package/esm/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceFeatureMenu.js +105 -0
  43. package/esm/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceTypeSelector.d.ts +5 -0
  44. package/esm/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceTypeSelector.js +64 -0
  45. package/esm/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SettingsDialog.d.ts +6 -0
  46. package/esm/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SettingsDialog.js +48 -0
  47. package/esm/BaseFeatureWidget/SequenceFeatureDetails/index.d.ts +1 -0
  48. package/esm/BaseFeatureWidget/SequenceFeatureDetails/index.js +1 -0
  49. package/esm/BaseFeatureWidget/SequenceFeatureDetails/model.d.ts +31 -0
  50. package/esm/BaseFeatureWidget/SequenceFeatureDetails/model.js +83 -0
  51. package/esm/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDNASequence.d.ts +16 -0
  52. package/esm/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDNASequence.js +83 -0
  53. package/esm/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDSSequence.d.ts +8 -0
  54. package/esm/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDSSequence.js +16 -0
  55. package/esm/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/GenomicSequence.d.ts +10 -0
  56. package/esm/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/GenomicSequence.js +52 -0
  57. package/esm/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/ProteinSequence.d.ts +9 -0
  58. package/esm/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/ProteinSequence.js +21 -0
  59. package/esm/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/SequenceDisplay.d.ts +10 -0
  60. package/esm/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/SequenceDisplay.js +22 -0
  61. package/esm/BaseFeatureWidget/SequenceFeatureDetails/test_data/DLGAP3.d.ts +80 -0
  62. package/esm/BaseFeatureWidget/SequenceFeatureDetails/test_data/DLGAP3.js +583 -0
  63. package/esm/BaseFeatureWidget/SequenceFeatureDetails/test_data/NCDN.d.ts +141 -0
  64. package/esm/BaseFeatureWidget/SequenceFeatureDetails/test_data/NCDN.js +1116 -0
  65. package/esm/BaseFeatureWidget/SequenceFeatureDetails/types.d.ts +8 -0
  66. package/esm/BaseFeatureWidget/SequenceFeatureDetails/types.js +1 -0
  67. package/esm/BaseFeatureWidget/SequenceFeatureDetails/useSequenceData.d.ts +13 -0
  68. package/esm/BaseFeatureWidget/SequenceFeatureDetails/useSequenceData.js +73 -0
  69. package/esm/BaseFeatureWidget/SequenceFeatureDetails/util.d.ts +10 -0
  70. package/esm/BaseFeatureWidget/SequenceFeatureDetails/util.js +42 -0
  71. package/esm/BaseFeatureWidget/configSchema.d.ts +2 -0
  72. package/esm/BaseFeatureWidget/configSchema.js +3 -0
  73. package/esm/BaseFeatureWidget/index.d.ts +2 -0
  74. package/esm/BaseFeatureWidget/index.js +2 -0
  75. package/esm/BaseFeatureWidget/stateModelFactory.d.ts +101 -0
  76. package/esm/BaseFeatureWidget/stateModelFactory.js +96 -0
  77. package/esm/BaseFeatureWidget/types.d.ts +22 -0
  78. package/esm/BaseFeatureWidget/types.js +1 -0
  79. package/esm/BaseFeatureWidget/util.d.ts +51 -0
  80. package/esm/BaseFeatureWidget/util.js +95 -0
  81. package/esm/CorePlugin.d.ts +6 -0
  82. package/esm/CorePlugin.js +24 -0
  83. package/esm/PhasedScheduler.js +25 -0
  84. package/esm/Plugin.d.ts +13 -0
  85. package/esm/Plugin.js +9 -0
  86. package/esm/PluginLoader.d.ts +64 -0
  87. package/esm/PluginLoader.js +164 -0
  88. package/esm/PluginManager.d.ts +125 -0
  89. package/esm/PluginManager.js +414 -0
  90. package/esm/ReExports/BaseFeatureDetails.js +9 -0
  91. package/esm/ReExports/DataGrid.js +1 -0
  92. package/esm/ReExports/MuiDataGridReExports.js +131 -0
  93. package/esm/ReExports/MuiReExports.d.ts +134 -0
  94. package/esm/ReExports/MuiReExports.js +115 -0
  95. package/esm/ReExports/index.d.ts +1 -0
  96. package/esm/ReExports/index.js +1 -0
  97. package/esm/ReExports/lazify.js +10 -0
  98. package/esm/ReExports/list.js +275 -0
  99. package/esm/ReExports/modules.js +149 -0
  100. package/esm/TextSearch/BaseResults.d.ts +46 -0
  101. package/esm/TextSearch/BaseResults.js +67 -0
  102. package/esm/TextSearch/TextSearchManager.d.ts +48 -0
  103. package/esm/TextSearch/TextSearchManager.js +77 -0
  104. package/esm/assemblyManager/assembly.d.ts +75 -0
  105. package/esm/assemblyManager/assembly.js +328 -0
  106. package/esm/assemblyManager/assemblyConfigSchema.d.ts +27 -0
  107. package/esm/assemblyManager/assemblyConfigSchema.js +51 -0
  108. package/esm/assemblyManager/assemblyManager.d.ts +528 -0
  109. package/esm/assemblyManager/assemblyManager.js +131 -0
  110. package/esm/assemblyManager/index.d.ts +3 -0
  111. package/esm/assemblyManager/index.js +2 -0
  112. package/esm/configuration/configurationSchema.d.ts +37 -0
  113. package/esm/configuration/configurationSchema.js +230 -0
  114. package/esm/configuration/configurationSlot.d.ts +33 -0
  115. package/esm/configuration/configurationSlot.js +239 -0
  116. package/esm/configuration/index.d.ts +3 -0
  117. package/esm/configuration/index.js +2 -0
  118. package/esm/configuration/types.d.ts +14 -0
  119. package/esm/configuration/types.js +1 -0
  120. package/esm/configuration/util.d.ts +10 -0
  121. package/esm/configuration/util.js +123 -0
  122. package/esm/data_adapters/BaseAdapter/BaseAdapter.d.ts +16 -0
  123. package/esm/data_adapters/BaseAdapter/BaseAdapter.js +31 -0
  124. package/esm/data_adapters/BaseAdapter/BaseFeatureDataAdapter.d.ts +24 -0
  125. package/esm/data_adapters/BaseAdapter/BaseFeatureDataAdapter.js +68 -0
  126. package/esm/data_adapters/BaseAdapter/BaseOptions.d.ts +18 -0
  127. package/esm/data_adapters/BaseAdapter/BaseOptions.js +1 -0
  128. package/esm/data_adapters/BaseAdapter/BaseRefNameAliasAdapter.d.ts +10 -0
  129. package/esm/data_adapters/BaseAdapter/BaseRefNameAliasAdapter.js +1 -0
  130. package/esm/data_adapters/BaseAdapter/BaseSequenceAdapter.d.ts +11 -0
  131. package/esm/data_adapters/BaseAdapter/BaseSequenceAdapter.js +12 -0
  132. package/esm/data_adapters/BaseAdapter/BaseTextSearchAdapter.d.ts +6 -0
  133. package/esm/data_adapters/BaseAdapter/BaseTextSearchAdapter.js +1 -0
  134. package/esm/data_adapters/BaseAdapter/RegionsAdapter.d.ts +6 -0
  135. package/esm/data_adapters/BaseAdapter/RegionsAdapter.js +1 -0
  136. package/esm/data_adapters/BaseAdapter/index.d.ts +13 -0
  137. package/esm/data_adapters/BaseAdapter/index.js +5 -0
  138. package/esm/data_adapters/BaseAdapter/stats.d.ts +10 -0
  139. package/esm/data_adapters/BaseAdapter/stats.js +48 -0
  140. package/esm/data_adapters/BaseAdapter/types.d.ts +23 -0
  141. package/esm/data_adapters/BaseAdapter/types.js +1 -0
  142. package/esm/data_adapters/BaseAdapter/util.d.ts +12 -0
  143. package/esm/data_adapters/BaseAdapter/util.js +15 -0
  144. package/esm/data_adapters/CytobandAdapter/CytobandAdapter.d.ts +6 -0
  145. package/esm/data_adapters/CytobandAdapter/CytobandAdapter.js +28 -0
  146. package/esm/data_adapters/CytobandAdapter/configSchema.d.ts +9 -0
  147. package/esm/data_adapters/CytobandAdapter/configSchema.js +24 -0
  148. package/esm/data_adapters/CytobandAdapter/index.d.ts +2 -0
  149. package/esm/data_adapters/CytobandAdapter/index.js +12 -0
  150. package/esm/data_adapters/dataAdapterCache.d.ts +14 -0
  151. package/esm/data_adapters/dataAdapterCache.js +54 -0
  152. package/esm/data_adapters/util.js +4 -0
  153. package/esm/pluggableElementTypes/AdapterType.d.ts +25 -0
  154. package/esm/pluggableElementTypes/AdapterType.js +17 -0
  155. package/esm/pluggableElementTypes/AddTrackWorkflowType.d.ts +17 -0
  156. package/esm/pluggableElementTypes/AddTrackWorkflowType.js +10 -0
  157. package/esm/pluggableElementTypes/ConnectionType.d.ts +20 -0
  158. package/esm/pluggableElementTypes/ConnectionType.js +16 -0
  159. package/esm/pluggableElementTypes/DisplayType.d.ts +30 -0
  160. package/esm/pluggableElementTypes/DisplayType.js +20 -0
  161. package/esm/pluggableElementTypes/GlyphType.d.ts +43 -0
  162. package/esm/pluggableElementTypes/GlyphType.js +18 -0
  163. package/esm/pluggableElementTypes/InternetAccountType.d.ts +12 -0
  164. package/esm/pluggableElementTypes/InternetAccountType.js +10 -0
  165. package/esm/pluggableElementTypes/PluggableElementBase.js +11 -0
  166. package/esm/pluggableElementTypes/RpcMethodType.d.ts +19 -0
  167. package/esm/pluggableElementTypes/RpcMethodType.js +88 -0
  168. package/esm/pluggableElementTypes/RpcMethodTypeWithFiltersAndRenameRegions.d.ts +11 -0
  169. package/esm/pluggableElementTypes/RpcMethodTypeWithFiltersAndRenameRegions.js +28 -0
  170. package/esm/pluggableElementTypes/TextSearchAdapterType.d.ts +18 -0
  171. package/esm/pluggableElementTypes/TextSearchAdapterType.js +15 -0
  172. package/esm/pluggableElementTypes/TrackType.d.ts +16 -0
  173. package/esm/pluggableElementTypes/TrackType.js +14 -0
  174. package/esm/pluggableElementTypes/ViewType.d.ts +29 -0
  175. package/esm/pluggableElementTypes/ViewType.js +18 -0
  176. package/esm/pluggableElementTypes/WidgetType.d.ts +27 -0
  177. package/esm/pluggableElementTypes/WidgetType.js +18 -0
  178. package/esm/pluggableElementTypes/index.d.ts +27 -0
  179. package/esm/pluggableElementTypes/index.js +14 -0
  180. package/esm/pluggableElementTypes/models/BaseConnectionModelFactory.d.ts +29 -0
  181. package/esm/pluggableElementTypes/models/BaseConnectionModelFactory.js +35 -0
  182. package/esm/pluggableElementTypes/models/BaseDisplayModel.d.ts +180 -0
  183. package/esm/pluggableElementTypes/models/BaseDisplayModel.js +104 -0
  184. package/esm/pluggableElementTypes/models/BaseTrackModel.d.ts +74 -0
  185. package/esm/pluggableElementTypes/models/BaseTrackModel.js +203 -0
  186. package/esm/pluggableElementTypes/models/BaseViewModel.d.ts +52 -0
  187. package/esm/pluggableElementTypes/models/BaseViewModel.js +42 -0
  188. package/esm/pluggableElementTypes/models/InternetAccountModel.d.ts +86 -0
  189. package/esm/pluggableElementTypes/models/InternetAccountModel.js +151 -0
  190. package/esm/pluggableElementTypes/models/baseConnectionConfig.d.ts +16 -0
  191. package/esm/pluggableElementTypes/models/baseConnectionConfig.js +18 -0
  192. package/esm/pluggableElementTypes/models/baseInternetAccountConfig.d.ts +27 -0
  193. package/esm/pluggableElementTypes/models/baseInternetAccountConfig.js +32 -0
  194. package/esm/pluggableElementTypes/models/baseTrackConfig.d.ts +87 -0
  195. package/esm/pluggableElementTypes/models/baseTrackConfig.js +134 -0
  196. package/esm/pluggableElementTypes/models/components/SaveTrackData.d.ts +11 -0
  197. package/esm/pluggableElementTypes/models/components/SaveTrackData.js +158 -0
  198. package/esm/pluggableElementTypes/models/index.d.ts +14 -0
  199. package/esm/pluggableElementTypes/models/index.js +8 -0
  200. package/esm/pluggableElementTypes/models/saveTrackFileTypes/bed.d.ts +4 -0
  201. package/esm/pluggableElementTypes/models/saveTrackFileTypes/bed.js +9 -0
  202. package/esm/pluggableElementTypes/models/saveTrackFileTypes/fetchSequence.d.ts +5 -0
  203. package/esm/pluggableElementTypes/models/saveTrackFileTypes/fetchSequence.js +17 -0
  204. package/esm/pluggableElementTypes/models/saveTrackFileTypes/genbank.d.ts +7 -0
  205. package/esm/pluggableElementTypes/models/saveTrackFileTypes/genbank.js +108 -0
  206. package/esm/pluggableElementTypes/models/saveTrackFileTypes/gff3.d.ts +5 -0
  207. package/esm/pluggableElementTypes/models/saveTrackFileTypes/gff3.js +91 -0
  208. package/esm/pluggableElementTypes/models/saveTrackFileTypes/types.d.ts +11 -0
  209. package/esm/pluggableElementTypes/models/saveTrackFileTypes/types.js +1 -0
  210. package/esm/pluggableElementTypes/renderers/BoxRendererType.d.ts +52 -0
  211. package/esm/pluggableElementTypes/renderers/BoxRendererType.js +78 -0
  212. package/esm/pluggableElementTypes/renderers/CircularChordRendererType.d.ts +4 -0
  213. package/esm/pluggableElementTypes/renderers/CircularChordRendererType.js +4 -0
  214. package/esm/pluggableElementTypes/renderers/FeatureRendererType.d.ts +58 -0
  215. package/esm/pluggableElementTypes/renderers/FeatureRendererType.js +77 -0
  216. package/esm/pluggableElementTypes/renderers/LayoutSession.d.ts +31 -0
  217. package/esm/pluggableElementTypes/renderers/LayoutSession.js +37 -0
  218. package/esm/pluggableElementTypes/renderers/RendererType.d.ts +28 -0
  219. package/esm/pluggableElementTypes/renderers/RendererType.js +20 -0
  220. package/esm/pluggableElementTypes/renderers/ServerSideRendererType.d.ts +57 -0
  221. package/esm/pluggableElementTypes/renderers/ServerSideRendererType.js +113 -0
  222. package/esm/pluggableElementTypes/renderers/index.d.ts +6 -0
  223. package/esm/pluggableElementTypes/renderers/index.js +6 -0
  224. package/esm/pluggableElementTypes/renderers/util/serializableFilterChain.js +30 -0
  225. package/esm/pluggableElementTypes/renderers/util.d.ts +3 -0
  226. package/esm/pluggableElementTypes/renderers/util.js +14 -0
  227. package/esm/rpc/BaseRpcDriver.d.ts +40 -0
  228. package/esm/rpc/BaseRpcDriver.js +116 -0
  229. package/esm/rpc/MainThreadRpcDriver.d.ts +14 -0
  230. package/esm/rpc/MainThreadRpcDriver.js +33 -0
  231. package/esm/rpc/RpcManager.d.ts +35 -0
  232. package/esm/rpc/RpcManager.js +63 -0
  233. package/esm/rpc/WebWorkerRpcDriver.d.ts +31 -0
  234. package/esm/rpc/WebWorkerRpcDriver.js +77 -0
  235. package/esm/rpc/baseRpcConfig.d.ts +8 -0
  236. package/esm/rpc/baseRpcConfig.js +10 -0
  237. package/esm/rpc/configSchema.d.ts +9 -0
  238. package/esm/rpc/configSchema.js +22 -0
  239. package/esm/rpc/coreRpcMethods.d.ts +12 -0
  240. package/esm/rpc/coreRpcMethods.js +12 -0
  241. package/esm/rpc/mainThreadRpcConfig.d.ts +8 -0
  242. package/esm/rpc/mainThreadRpcConfig.js +8 -0
  243. package/esm/rpc/methods/CoreFreeResources.d.ts +6 -0
  244. package/esm/rpc/methods/CoreFreeResources.js +14 -0
  245. package/esm/rpc/methods/CoreGetExportData.d.ts +19 -0
  246. package/esm/rpc/methods/CoreGetExportData.js +18 -0
  247. package/esm/rpc/methods/CoreGetFeatureDensityStats.d.ts +17 -0
  248. package/esm/rpc/methods/CoreGetFeatureDensityStats.js +25 -0
  249. package/esm/rpc/methods/CoreGetFeatureDetails.d.ts +11 -0
  250. package/esm/rpc/methods/CoreGetFeatureDetails.js +24 -0
  251. package/esm/rpc/methods/CoreGetFeatures.d.ts +18 -0
  252. package/esm/rpc/methods/CoreGetFeatures.js +31 -0
  253. package/esm/rpc/methods/CoreGetFileInfo.d.ts +9 -0
  254. package/esm/rpc/methods/CoreGetFileInfo.js +15 -0
  255. package/esm/rpc/methods/CoreGetMetadata.d.ts +9 -0
  256. package/esm/rpc/methods/CoreGetMetadata.js +15 -0
  257. package/esm/rpc/methods/CoreGetRefNames.d.ts +10 -0
  258. package/esm/rpc/methods/CoreGetRefNames.js +19 -0
  259. package/esm/rpc/methods/CoreGetRegions.d.ts +8 -0
  260. package/esm/rpc/methods/CoreGetRegions.js +15 -0
  261. package/esm/rpc/methods/CoreGetSequence.d.ts +13 -0
  262. package/esm/rpc/methods/CoreGetSequence.js +17 -0
  263. package/esm/rpc/methods/CoreRender.d.ts +14 -0
  264. package/esm/rpc/methods/CoreRender.js +35 -0
  265. package/esm/rpc/methods/CoreSaveFeatureData.d.ts +16 -0
  266. package/esm/rpc/methods/CoreSaveFeatureData.js +32 -0
  267. package/esm/rpc/methods/util.d.ts +15 -0
  268. package/esm/rpc/methods/util.js +7 -0
  269. package/esm/rpc/webWorkerRpcConfig.d.ts +8 -0
  270. package/esm/rpc/webWorkerRpcConfig.js +8 -0
  271. package/esm/ui/AppLogo.d.ts +7 -0
  272. package/esm/ui/AppLogo.js +10 -0
  273. package/esm/ui/AssemblySelector.d.ts +13 -0
  274. package/esm/ui/AssemblySelector.js +39 -0
  275. package/esm/ui/BaseTooltip.d.ts +8 -0
  276. package/esm/ui/BaseTooltip.js +42 -0
  277. package/esm/ui/CascadingMenu.d.ts +30 -0
  278. package/esm/ui/CascadingMenu.js +48 -0
  279. package/esm/ui/CascadingMenuButton.d.ts +26 -0
  280. package/esm/ui/CascadingMenuButton.js +24 -0
  281. package/esm/ui/CascadingMenuHelpDialog.d.ts +5 -0
  282. package/esm/ui/CascadingMenuHelpDialog.js +10 -0
  283. package/esm/ui/CascadingMenuHelpIconButton.d.ts +5 -0
  284. package/esm/ui/CascadingMenuHelpIconButton.js +15 -0
  285. package/esm/ui/ColorPicker.js +62 -0
  286. package/esm/ui/ConfirmDialog.d.ts +10 -0
  287. package/esm/ui/ConfirmDialog.js +13 -0
  288. package/esm/ui/DataGridFlexContainer.d.ts +5 -0
  289. package/esm/ui/DataGridFlexContainer.js +12 -0
  290. package/esm/ui/Dialog.d.ts +7 -0
  291. package/esm/ui/Dialog.js +45 -0
  292. package/esm/ui/DraggableDialog.js +27 -0
  293. package/esm/ui/DropDownMenu.d.ts +6 -0
  294. package/esm/ui/DropDownMenu.js +24 -0
  295. package/esm/ui/EditableTypography.js +60 -0
  296. package/esm/ui/ErrorBoundary.d.ts +17 -0
  297. package/esm/ui/ErrorBoundary.js +16 -0
  298. package/esm/ui/ErrorMessage.js +56 -0
  299. package/esm/ui/ErrorMessageStackTraceContents.d.ts +4 -0
  300. package/esm/ui/ErrorMessageStackTraceContents.js +25 -0
  301. package/esm/ui/ErrorMessageStackTraceDialog.js +108 -0
  302. package/esm/ui/ExternalLink.js +7 -0
  303. package/esm/ui/FactoryResetDialog.js +18 -0
  304. package/esm/ui/FatalErrorDialog.js +18 -0
  305. package/esm/ui/FileSelector/FileSelector.d.ts +11 -0
  306. package/esm/ui/FileSelector/FileSelector.js +52 -0
  307. package/esm/ui/FileSelector/LocalFileChooser.d.ts +6 -0
  308. package/esm/ui/FileSelector/LocalFileChooser.js +39 -0
  309. package/esm/ui/FileSelector/LocationInput.d.ts +9 -0
  310. package/esm/ui/FileSelector/LocationInput.js +15 -0
  311. package/esm/ui/FileSelector/SourceTypeSelector.d.ts +9 -0
  312. package/esm/ui/FileSelector/SourceTypeSelector.js +38 -0
  313. package/esm/ui/FileSelector/UrlChooser.d.ts +8 -0
  314. package/esm/ui/FileSelector/UrlChooser.js +17 -0
  315. package/esm/ui/FileSelector/index.d.ts +1 -0
  316. package/esm/ui/FileSelector/index.js +1 -0
  317. package/esm/ui/FileSelector/useInternetAccounts.d.ts +178 -0
  318. package/esm/ui/FileSelector/useInternetAccounts.js +18 -0
  319. package/esm/ui/HoverMenu.js +15 -0
  320. package/esm/ui/Icons.js +14 -0
  321. package/esm/ui/LoadingEllipses.d.ts +7 -0
  322. package/esm/ui/LoadingEllipses.js +31 -0
  323. package/esm/ui/Logo.js +42 -0
  324. package/esm/ui/Menu.d.ts +2 -0
  325. package/esm/ui/Menu.js +1 -0
  326. package/esm/ui/MenuButton.d.ts +1 -0
  327. package/esm/ui/MenuButton.js +1 -0
  328. package/esm/ui/MenuItems.d.ts +15 -0
  329. package/esm/ui/MenuItems.js +59 -0
  330. package/esm/ui/MenuTypes.d.ts +39 -0
  331. package/esm/ui/MenuTypes.js +1 -0
  332. package/esm/ui/PrerenderedCanvas.d.ts +10 -0
  333. package/esm/ui/PrerenderedCanvas.js +33 -0
  334. package/esm/ui/RedErrorMessageBox.js +16 -0
  335. package/esm/ui/ResizeHandle.js +67 -0
  336. package/esm/ui/ReturnToImportFormDialog.js +13 -0
  337. package/esm/ui/SanitizedHTML.js +61 -0
  338. package/esm/ui/Snackbar.d.ts +10 -0
  339. package/esm/ui/Snackbar.js +14 -0
  340. package/esm/ui/SnackbarContents.d.ts +5 -0
  341. package/esm/ui/SnackbarContents.js +11 -0
  342. package/esm/ui/SnackbarModel.d.ts +17 -0
  343. package/esm/ui/SnackbarModel.js +55 -0
  344. package/esm/ui/colors.js +67 -0
  345. package/esm/ui/index.d.ts +20 -0
  346. package/esm/ui/index.js +20 -0
  347. package/esm/ui/react-colorful.d.ts +3 -0
  348. package/esm/ui/react-colorful.js +416 -0
  349. package/esm/ui/theme.d.ts +58 -0
  350. package/esm/ui/theme.js +392 -0
  351. package/esm/ui/useEvent.js +10 -0
  352. package/esm/util/Base1DUtils.d.ts +38 -0
  353. package/esm/util/Base1DUtils.js +205 -0
  354. package/esm/util/Base1DViewModel.d.ts +61 -0
  355. package/esm/util/Base1DViewModel.js +129 -0
  356. package/esm/util/QuickLRU/index.d.ts +1 -0
  357. package/esm/util/QuickLRU/index.js +1 -0
  358. package/esm/util/TimeTraveller.d.ts +19 -0
  359. package/esm/util/TimeTraveller.js +94 -0
  360. package/esm/util/aborting.js +42 -0
  361. package/esm/util/analytics.js +80 -0
  362. package/esm/util/blobToDataURL.js +14 -0
  363. package/esm/util/blockTypes.d.ts +59 -0
  364. package/esm/util/blockTypes.js +119 -0
  365. package/esm/util/calculateDynamicBlocks.d.ts +3 -0
  366. package/esm/util/calculateDynamicBlocks.js +104 -0
  367. package/esm/util/calculateStaticBlocks.d.ts +13 -0
  368. package/esm/util/calculateStaticBlocks.js +106 -0
  369. package/esm/util/coarseStripHTML.d.ts +1 -0
  370. package/esm/util/coarseStripHTML.js +17 -0
  371. package/esm/util/color/cssColorsLevel4.js +156 -0
  372. package/esm/util/color/index.d.ts +5 -0
  373. package/esm/util/color/index.js +39 -0
  374. package/esm/util/colord.d.ts +9 -0
  375. package/esm/util/colord.js +14 -0
  376. package/esm/util/compositeMap.d.ts +11 -0
  377. package/esm/util/compositeMap.js +59 -0
  378. package/esm/util/convertCodingSequenceToPeptides.d.ts +6 -0
  379. package/esm/util/convertCodingSequenceToPeptides.js +9 -0
  380. package/esm/util/dedupe.js +12 -0
  381. package/esm/util/fetchSeq.d.ts +8 -0
  382. package/esm/util/fetchSeq.js +23 -0
  383. package/esm/util/flatbush/index.d.ts +25 -0
  384. package/esm/util/flatbush/index.js +423 -0
  385. package/esm/util/flatqueue/index.d.ts +11 -0
  386. package/esm/util/flatqueue/index.js +61 -0
  387. package/esm/util/formatFastaStrings.js +8 -0
  388. package/esm/util/idMaker.js +21 -0
  389. package/esm/util/index.d.ts +271 -0
  390. package/esm/util/index.js +873 -0
  391. package/esm/util/io/RemoteFileWithRangeCache.js +71 -0
  392. package/esm/util/io/index.d.ts +7 -0
  393. package/esm/util/io/index.js +92 -0
  394. package/esm/util/isWebWorker.d.ts +1 -0
  395. package/esm/util/isWebWorker.js +4 -0
  396. package/esm/util/jexl.d.ts +2 -0
  397. package/esm/util/jexl.js +49 -0
  398. package/esm/util/jexlStrings.js +17 -0
  399. package/esm/util/layouts/BaseLayout.d.ts +30 -0
  400. package/esm/util/layouts/BaseLayout.js +1 -0
  401. package/esm/util/layouts/GranularRectLayout.d.ts +37 -0
  402. package/esm/util/layouts/GranularRectLayout.js +418 -0
  403. package/esm/util/layouts/MultiLayout.d.ts +12 -0
  404. package/esm/util/layouts/MultiLayout.js +40 -0
  405. package/esm/util/layouts/PileupLayout.d.ts +41 -0
  406. package/esm/util/layouts/PileupLayout.js +202 -0
  407. package/esm/util/layouts/PrecomputedLayout.d.ts +30 -0
  408. package/esm/util/layouts/PrecomputedLayout.js +71 -0
  409. package/esm/util/layouts/SceneGraph.js +121 -0
  410. package/esm/util/layouts/index.d.ts +8 -0
  411. package/esm/util/layouts/index.js +6 -0
  412. package/esm/util/layouts/intervalUtils.d.ts +3 -0
  413. package/esm/util/layouts/intervalUtils.js +63 -0
  414. package/esm/util/librpc.d.ts +2 -0
  415. package/esm/util/librpc.js +1 -0
  416. package/esm/util/linkify.d.ts +1 -0
  417. package/esm/util/linkify.js +5 -0
  418. package/esm/util/locString.d.ts +9 -0
  419. package/esm/util/locString.js +62 -0
  420. package/esm/util/makeAbortableReaction.d.ts +3 -0
  421. package/esm/util/makeAbortableReaction.js +47 -0
  422. package/esm/util/map-obj/index.d.ts +13 -0
  423. package/esm/util/map-obj/index.js +92 -0
  424. package/esm/util/mst-reflection.d.ts +11 -0
  425. package/esm/util/mst-reflection.js +54 -0
  426. package/esm/util/nanoid.d.ts +5 -0
  427. package/esm/util/nanoid.js +36 -0
  428. package/esm/util/nextTick.js +3 -0
  429. package/esm/util/offscreenCanvasGetSerializingSvg.d.ts +5 -0
  430. package/esm/util/offscreenCanvasGetSerializingSvg.js +9 -0
  431. package/esm/util/offscreenCanvasPonyfill.d.ts +5 -0
  432. package/esm/util/offscreenCanvasPonyfill.js +57 -0
  433. package/esm/util/offscreenCanvasUtils.d.ts +12 -0
  434. package/esm/util/offscreenCanvasUtils.js +19 -0
  435. package/esm/util/parseLineByLine.js +22 -0
  436. package/esm/util/range.js +21 -0
  437. package/esm/util/renderToAbstractCanvas.d.ts +17 -0
  438. package/esm/util/renderToAbstractCanvas.js +53 -0
  439. package/esm/util/rpc.d.ts +2 -0
  440. package/esm/util/rpc.js +6 -0
  441. package/esm/util/rxjs.d.ts +4 -0
  442. package/esm/util/rxjs.js +16 -0
  443. package/esm/util/simpleFeature.d.ts +44 -0
  444. package/esm/util/simpleFeature.js +81 -0
  445. package/esm/util/stats.d.ts +23 -0
  446. package/esm/util/stats.js +72 -0
  447. package/esm/util/stopToken.d.ts +19 -0
  448. package/esm/util/stopToken.js +90 -0
  449. package/esm/util/tracks.d.ts +72 -0
  450. package/esm/util/tracks.js +214 -0
  451. package/esm/util/transferables.d.ts +2 -0
  452. package/esm/util/transferables.js +35 -0
  453. package/esm/util/tss-react/cssAndCx.d.ts +16 -0
  454. package/esm/util/tss-react/cssAndCx.js +97 -0
  455. package/esm/util/tss-react/index.d.ts +4 -0
  456. package/esm/util/tss-react/index.js +7 -0
  457. package/esm/util/tss-react/makeStyles.d.ts +15 -0
  458. package/esm/util/tss-react/makeStyles.js +38 -0
  459. package/esm/util/tss-react/mergeClasses.d.ts +2 -0
  460. package/esm/util/tss-react/mergeClasses.js +24 -0
  461. package/esm/util/tss-react/mui/index.d.ts +1 -0
  462. package/esm/util/tss-react/mui/index.js +1 -0
  463. package/esm/util/tss-react/mui/mui.d.ts +10 -0
  464. package/esm/util/tss-react/mui/mui.js +5 -0
  465. package/esm/util/tss-react/tools/classnames.d.ts +2 -0
  466. package/esm/util/tss-react/tools/classnames.js +44 -0
  467. package/esm/util/tss-react/tools/getDependencyArrayRef.d.ts +1 -0
  468. package/esm/util/tss-react/tools/getDependencyArrayRef.js +19 -0
  469. package/esm/util/tss-react/types.d.ts +13 -0
  470. package/esm/util/tss-react/types.js +6 -0
  471. package/esm/util/types/ElementId.d.ts +1 -0
  472. package/esm/util/types/ElementId.js +3 -0
  473. package/esm/util/types/index.d.ts +273 -0
  474. package/esm/util/types/index.js +131 -0
  475. package/esm/util/types/mst.d.ts +107 -0
  476. package/esm/util/types/mst.js +68 -0
  477. package/esm/util/types/util.d.ts +6 -0
  478. package/esm/util/types/util.js +1 -0
  479. package/esm/util/useFeatureSequence.d.ts +19 -0
  480. package/esm/util/useFeatureSequence.js +87 -0
  481. package/esm/util/useMeasure.js +30 -0
  482. package/esm/util/when.js +1 -0
  483. package/package.json +487 -39
  484. package/BaseFeatureWidget/BaseFeatureDetail/ArrayValue.js +0 -38
  485. package/BaseFeatureWidget/BaseFeatureDetail/Attributes.d.ts +0 -13
  486. package/BaseFeatureWidget/BaseFeatureDetail/Attributes.js +0 -48
  487. package/BaseFeatureWidget/BaseFeatureDetail/BaseAttributes.d.ts +0 -8
  488. package/BaseFeatureWidget/BaseFeatureDetail/BaseAttributes.js +0 -13
  489. package/BaseFeatureWidget/BaseFeatureDetail/BaseCard.d.ts +0 -2
  490. package/BaseFeatureWidget/BaseFeatureDetail/BaseCard.js +0 -23
  491. package/BaseFeatureWidget/BaseFeatureDetail/BaseCoreDetails.d.ts +0 -2
  492. package/BaseFeatureWidget/BaseFeatureDetail/BaseCoreDetails.js +0 -13
  493. package/BaseFeatureWidget/BaseFeatureDetail/BasicValue.js +0 -23
  494. package/BaseFeatureWidget/BaseFeatureDetail/CoreDetails.d.ts +0 -2
  495. package/BaseFeatureWidget/BaseFeatureDetail/CoreDetails.js +0 -30
  496. package/BaseFeatureWidget/BaseFeatureDetail/DataGridDetails.js +0 -63
  497. package/BaseFeatureWidget/BaseFeatureDetail/FeatureDetails.d.ts +0 -11
  498. package/BaseFeatureWidget/BaseFeatureDetail/FeatureDetails.js +0 -48
  499. package/BaseFeatureWidget/BaseFeatureDetail/FieldName.js +0 -27
  500. package/BaseFeatureWidget/BaseFeatureDetail/Position.d.ts +0 -2
  501. package/BaseFeatureWidget/BaseFeatureDetail/Position.js +0 -17
  502. package/BaseFeatureWidget/BaseFeatureDetail/SimpleField.js +0 -20
  503. package/BaseFeatureWidget/BaseFeatureDetail/UriField.js +0 -28
  504. package/BaseFeatureWidget/BaseFeatureDetail/index.d.ts +0 -7
  505. package/BaseFeatureWidget/BaseFeatureDetail/index.js +0 -34
  506. package/BaseFeatureWidget/BaseFeatureDetail/types.d.ts +0 -7
  507. package/BaseFeatureWidget/BaseFeatureDetail/types.js +0 -2
  508. package/BaseFeatureWidget/BaseFeatureDetail/util.js +0 -32
  509. package/BaseFeatureWidget/SequenceFeatureDetails/SequenceContents.d.ts +0 -10
  510. package/BaseFeatureWidget/SequenceFeatureDetails/SequenceContents.js +0 -48
  511. package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeatureDetails.d.ts +0 -7
  512. package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeatureDetails.js +0 -74
  513. package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeaturePanel.d.ts +0 -7
  514. package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeaturePanel.js +0 -72
  515. package/BaseFeatureWidget/SequenceFeatureDetails/SequenceName.d.ts +0 -8
  516. package/BaseFeatureWidget/SequenceFeatureDetails/SequenceName.js +0 -28
  517. package/BaseFeatureWidget/SequenceFeatureDetails/SequencePanel.d.ts +0 -3
  518. package/BaseFeatureWidget/SequenceFeatureDetails/SequencePanel.js +0 -34
  519. package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/HelpDialog.js +0 -17
  520. package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceDialog.d.ts +0 -8
  521. package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceDialog.js +0 -40
  522. package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceFeatureMenu.d.ts +0 -8
  523. package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceFeatureMenu.js +0 -141
  524. package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceTypeSelector.d.ts +0 -5
  525. package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceTypeSelector.js +0 -66
  526. package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SettingsDialog.d.ts +0 -6
  527. package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SettingsDialog.js +0 -50
  528. package/BaseFeatureWidget/SequenceFeatureDetails/hooks.d.ts +0 -10
  529. package/BaseFeatureWidget/SequenceFeatureDetails/hooks.js +0 -65
  530. package/BaseFeatureWidget/SequenceFeatureDetails/index.d.ts +0 -1
  531. package/BaseFeatureWidget/SequenceFeatureDetails/index.js +0 -8
  532. package/BaseFeatureWidget/SequenceFeatureDetails/model.d.ts +0 -28
  533. package/BaseFeatureWidget/SequenceFeatureDetails/model.js +0 -81
  534. package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDNASequence.d.ts +0 -16
  535. package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDNASequence.js +0 -88
  536. package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDSSequence.d.ts +0 -8
  537. package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDSSequence.js +0 -20
  538. package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/GenomicSequence.d.ts +0 -10
  539. package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/GenomicSequence.js +0 -56
  540. package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/ProteinSequence.d.ts +0 -9
  541. package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/ProteinSequence.js +0 -25
  542. package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/SequenceDisplay.d.ts +0 -10
  543. package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/SequenceDisplay.js +0 -25
  544. package/BaseFeatureWidget/SequenceFeatureDetails/test_data/DLGAP3.d.ts +0 -80
  545. package/BaseFeatureWidget/SequenceFeatureDetails/test_data/DLGAP3.js +0 -585
  546. package/BaseFeatureWidget/SequenceFeatureDetails/test_data/NCDN.d.ts +0 -141
  547. package/BaseFeatureWidget/SequenceFeatureDetails/test_data/NCDN.js +0 -1118
  548. package/BaseFeatureWidget/SequenceFeatureDetails/types.d.ts +0 -8
  549. package/BaseFeatureWidget/SequenceFeatureDetails/types.js +0 -2
  550. package/BaseFeatureWidget/SequenceFeatureDetails/util.d.ts +0 -17
  551. package/BaseFeatureWidget/SequenceFeatureDetails/util.js +0 -49
  552. package/BaseFeatureWidget/configSchema.d.ts +0 -2
  553. package/BaseFeatureWidget/configSchema.js +0 -6
  554. package/BaseFeatureWidget/index.d.ts +0 -2
  555. package/BaseFeatureWidget/index.js +0 -7
  556. package/BaseFeatureWidget/stateModelFactory.d.ts +0 -101
  557. package/BaseFeatureWidget/stateModelFactory.js +0 -99
  558. package/BaseFeatureWidget/types.d.ts +0 -22
  559. package/BaseFeatureWidget/types.js +0 -2
  560. package/BaseFeatureWidget/util.d.ts +0 -48
  561. package/BaseFeatureWidget/util.js +0 -77
  562. package/CorePlugin.d.ts +0 -6
  563. package/CorePlugin.js +0 -66
  564. package/PhasedScheduler.js +0 -28
  565. package/Plugin.d.ts +0 -13
  566. package/Plugin.js +0 -7
  567. package/PluginLoader.d.ts +0 -64
  568. package/PluginLoader.js +0 -174
  569. package/PluginManager.d.ts +0 -139
  570. package/PluginManager.js +0 -405
  571. package/ReExports/BaseFeatureDetails.js +0 -45
  572. package/ReExports/DataGrid.js +0 -5
  573. package/ReExports/MuiDataGridReExports.js +0 -167
  574. package/ReExports/MuiReExports.d.ts +0 -133
  575. package/ReExports/MuiReExports.js +0 -150
  576. package/ReExports/index.d.ts +0 -1
  577. package/ReExports/index.js +0 -8
  578. package/ReExports/lazify.js +0 -14
  579. package/ReExports/list.js +0 -273
  580. package/ReExports/material-ui-colors.d.ts +0 -1
  581. package/ReExports/material-ui-colors.js +0 -17
  582. package/ReExports/modules.js +0 -179
  583. package/TextSearch/BaseResults.d.ts +0 -46
  584. package/TextSearch/BaseResults.js +0 -61
  585. package/TextSearch/TextSearchManager.d.ts +0 -48
  586. package/TextSearch/TextSearchManager.js +0 -85
  587. package/assemblyManager/assembly.d.ts +0 -71
  588. package/assemblyManager/assembly.js +0 -304
  589. package/assemblyManager/assemblyConfigSchema.d.ts +0 -27
  590. package/assemblyManager/assemblyConfigSchema.js +0 -53
  591. package/assemblyManager/assemblyManager.d.ts +0 -499
  592. package/assemblyManager/assemblyManager.js +0 -134
  593. package/assemblyManager/index.d.ts +0 -3
  594. package/assemblyManager/index.js +0 -10
  595. package/configuration/configurationSchema.d.ts +0 -35
  596. package/configuration/configurationSchema.js +0 -174
  597. package/configuration/configurationSlot.d.ts +0 -31
  598. package/configuration/configurationSlot.js +0 -241
  599. package/configuration/index.d.ts +0 -3
  600. package/configuration/index.js +0 -21
  601. package/configuration/types.d.ts +0 -14
  602. package/configuration/types.js +0 -2
  603. package/configuration/util.d.ts +0 -10
  604. package/configuration/util.js +0 -123
  605. package/data_adapters/BaseAdapter/BaseAdapter.d.ts +0 -14
  606. package/data_adapters/BaseAdapter/BaseAdapter.js +0 -30
  607. package/data_adapters/BaseAdapter/BaseFeatureDataAdapter.d.ts +0 -24
  608. package/data_adapters/BaseAdapter/BaseFeatureDataAdapter.js +0 -115
  609. package/data_adapters/BaseAdapter/BaseOptions.d.ts +0 -15
  610. package/data_adapters/BaseAdapter/BaseOptions.js +0 -2
  611. package/data_adapters/BaseAdapter/BaseRefNameAliasAdapter.d.ts +0 -10
  612. package/data_adapters/BaseAdapter/BaseRefNameAliasAdapter.js +0 -2
  613. package/data_adapters/BaseAdapter/BaseSequenceAdapter.d.ts +0 -10
  614. package/data_adapters/BaseAdapter/BaseSequenceAdapter.js +0 -10
  615. package/data_adapters/BaseAdapter/BaseTextSearchAdapter.d.ts +0 -6
  616. package/data_adapters/BaseAdapter/BaseTextSearchAdapter.js +0 -2
  617. package/data_adapters/BaseAdapter/RegionsAdapter.d.ts +0 -6
  618. package/data_adapters/BaseAdapter/RegionsAdapter.js +0 -2
  619. package/data_adapters/BaseAdapter/index.d.ts +0 -13
  620. package/data_adapters/BaseAdapter/index.js +0 -25
  621. package/data_adapters/BaseAdapter/types.d.ts +0 -21
  622. package/data_adapters/BaseAdapter/types.js +0 -2
  623. package/data_adapters/BaseAdapter/util.d.ts +0 -12
  624. package/data_adapters/BaseAdapter/util.js +0 -22
  625. package/data_adapters/CytobandAdapter/CytobandAdapter.d.ts +0 -6
  626. package/data_adapters/CytobandAdapter/CytobandAdapter.js +0 -31
  627. package/data_adapters/CytobandAdapter/configSchema.d.ts +0 -9
  628. package/data_adapters/CytobandAdapter/configSchema.js +0 -26
  629. package/data_adapters/CytobandAdapter/index.d.ts +0 -2
  630. package/data_adapters/CytobandAdapter/index.js +0 -51
  631. package/data_adapters/dataAdapterCache.d.ts +0 -14
  632. package/data_adapters/dataAdapterCache.js +0 -60
  633. package/data_adapters/util.js +0 -10
  634. package/pluggableElementTypes/AdapterType.d.ts +0 -25
  635. package/pluggableElementTypes/AdapterType.js +0 -19
  636. package/pluggableElementTypes/AddTrackWorkflowType.d.ts +0 -17
  637. package/pluggableElementTypes/AddTrackWorkflowType.js +0 -14
  638. package/pluggableElementTypes/ConnectionType.d.ts +0 -20
  639. package/pluggableElementTypes/ConnectionType.js +0 -17
  640. package/pluggableElementTypes/DisplayType.d.ts +0 -28
  641. package/pluggableElementTypes/DisplayType.js +0 -18
  642. package/pluggableElementTypes/InternetAccountType.d.ts +0 -12
  643. package/pluggableElementTypes/InternetAccountType.js +0 -14
  644. package/pluggableElementTypes/PluggableElementBase.js +0 -12
  645. package/pluggableElementTypes/RpcMethodType.d.ts +0 -17
  646. package/pluggableElementTypes/RpcMethodType.js +0 -69
  647. package/pluggableElementTypes/RpcMethodTypeWithFiltersAndRenameRegions.d.ts +0 -11
  648. package/pluggableElementTypes/RpcMethodTypeWithFiltersAndRenameRegions.js +0 -35
  649. package/pluggableElementTypes/TextSearchAdapterType.d.ts +0 -18
  650. package/pluggableElementTypes/TextSearchAdapterType.js +0 -18
  651. package/pluggableElementTypes/TrackType.d.ts +0 -16
  652. package/pluggableElementTypes/TrackType.js +0 -18
  653. package/pluggableElementTypes/ViewType.d.ts +0 -29
  654. package/pluggableElementTypes/ViewType.js +0 -21
  655. package/pluggableElementTypes/WidgetType.d.ts +0 -25
  656. package/pluggableElementTypes/WidgetType.js +0 -17
  657. package/pluggableElementTypes/index.d.ts +0 -26
  658. package/pluggableElementTypes/index.js +0 -44
  659. package/pluggableElementTypes/models/BaseConnectionModelFactory.d.ts +0 -29
  660. package/pluggableElementTypes/models/BaseConnectionModelFactory.js +0 -38
  661. package/pluggableElementTypes/models/BaseDisplayModel.d.ts +0 -68
  662. package/pluggableElementTypes/models/BaseDisplayModel.js +0 -81
  663. package/pluggableElementTypes/models/BaseTrackModel.d.ts +0 -53
  664. package/pluggableElementTypes/models/BaseTrackModel.js +0 -145
  665. package/pluggableElementTypes/models/BaseViewModel.d.ts +0 -42
  666. package/pluggableElementTypes/models/BaseViewModel.js +0 -35
  667. package/pluggableElementTypes/models/InternetAccountModel.d.ts +0 -86
  668. package/pluggableElementTypes/models/InternetAccountModel.js +0 -155
  669. package/pluggableElementTypes/models/baseConnectionConfig.d.ts +0 -16
  670. package/pluggableElementTypes/models/baseConnectionConfig.js +0 -20
  671. package/pluggableElementTypes/models/baseInternetAccountConfig.d.ts +0 -27
  672. package/pluggableElementTypes/models/baseInternetAccountConfig.js +0 -35
  673. package/pluggableElementTypes/models/baseTrackConfig.d.ts +0 -82
  674. package/pluggableElementTypes/models/baseTrackConfig.js +0 -135
  675. package/pluggableElementTypes/models/index.d.ts +0 -13
  676. package/pluggableElementTypes/models/index.js +0 -22
  677. package/pluggableElementTypes/renderers/BoxRendererType.d.ts +0 -60
  678. package/pluggableElementTypes/renderers/BoxRendererType.js +0 -102
  679. package/pluggableElementTypes/renderers/CircularChordRendererType.d.ts +0 -26
  680. package/pluggableElementTypes/renderers/CircularChordRendererType.js +0 -34
  681. package/pluggableElementTypes/renderers/ComparativeServerSideRendererType.d.ts +0 -38
  682. package/pluggableElementTypes/renderers/ComparativeServerSideRendererType.js +0 -65
  683. package/pluggableElementTypes/renderers/FeatureRendererType.d.ts +0 -51
  684. package/pluggableElementTypes/renderers/FeatureRendererType.js +0 -85
  685. package/pluggableElementTypes/renderers/LayoutSession.d.ts +0 -25
  686. package/pluggableElementTypes/renderers/LayoutSession.js +0 -42
  687. package/pluggableElementTypes/renderers/RendererType.d.ts +0 -25
  688. package/pluggableElementTypes/renderers/RendererType.js +0 -23
  689. package/pluggableElementTypes/renderers/RpcRenderedSvgGroup.d.ts +0 -9
  690. package/pluggableElementTypes/renderers/RpcRenderedSvgGroup.js +0 -9
  691. package/pluggableElementTypes/renderers/ServerSideRenderedContent.d.ts +0 -6
  692. package/pluggableElementTypes/renderers/ServerSideRenderedContent.js +0 -8
  693. package/pluggableElementTypes/renderers/ServerSideRendererType.d.ts +0 -49
  694. package/pluggableElementTypes/renderers/ServerSideRendererType.js +0 -81
  695. package/pluggableElementTypes/renderers/index.d.ts +0 -7
  696. package/pluggableElementTypes/renderers/index.js +0 -20
  697. package/pluggableElementTypes/renderers/util/serializableFilterChain.js +0 -32
  698. package/rpc/BaseRpcDriver.d.ts +0 -43
  699. package/rpc/BaseRpcDriver.js +0 -113
  700. package/rpc/MainThreadRpcDriver.d.ts +0 -14
  701. package/rpc/MainThreadRpcDriver.js +0 -32
  702. package/rpc/RpcManager.d.ts +0 -34
  703. package/rpc/RpcManager.js +0 -69
  704. package/rpc/WebWorkerRpcDriver.d.ts +0 -29
  705. package/rpc/WebWorkerRpcDriver.js +0 -65
  706. package/rpc/baseRpcConfig.d.ts +0 -8
  707. package/rpc/baseRpcConfig.js +0 -12
  708. package/rpc/configSchema.d.ts +0 -9
  709. package/rpc/configSchema.js +0 -27
  710. package/rpc/coreRpcMethods.d.ts +0 -9
  711. package/rpc/coreRpcMethods.js +0 -22
  712. package/rpc/mainThreadRpcConfig.d.ts +0 -8
  713. package/rpc/mainThreadRpcConfig.js +0 -13
  714. package/rpc/methods/CoreFreeResources.d.ts +0 -6
  715. package/rpc/methods/CoreFreeResources.js +0 -23
  716. package/rpc/methods/CoreGetFeatureDensityStats.d.ts +0 -17
  717. package/rpc/methods/CoreGetFeatureDensityStats.js +0 -36
  718. package/rpc/methods/CoreGetFeatureDetails.d.ts +0 -11
  719. package/rpc/methods/CoreGetFeatureDetails.js +0 -38
  720. package/rpc/methods/CoreGetFeatures.d.ts +0 -18
  721. package/rpc/methods/CoreGetFeatures.js +0 -40
  722. package/rpc/methods/CoreGetFileInfo.d.ts +0 -9
  723. package/rpc/methods/CoreGetFileInfo.js +0 -24
  724. package/rpc/methods/CoreGetMetadata.d.ts +0 -9
  725. package/rpc/methods/CoreGetMetadata.js +0 -24
  726. package/rpc/methods/CoreGetRefNames.d.ts +0 -9
  727. package/rpc/methods/CoreGetRefNames.js +0 -25
  728. package/rpc/methods/CoreRender.d.ts +0 -10
  729. package/rpc/methods/CoreRender.js +0 -46
  730. package/rpc/methods/util.d.ts +0 -15
  731. package/rpc/methods/util.js +0 -9
  732. package/rpc/webWorkerRpcConfig.d.ts +0 -8
  733. package/rpc/webWorkerRpcConfig.js +0 -13
  734. package/stories/JBrowseCore.stories.d.ts +0 -5
  735. package/stories/JBrowseCore.stories.js +0 -10
  736. package/stories/examples/WithSequencePanel.d.ts +0 -6
  737. package/stories/examples/WithSequencePanel.js +0 -42
  738. package/stories/examples/index.d.ts +0 -1
  739. package/stories/examples/index.js +0 -17
  740. package/stories/examples/util.d.ts +0 -33
  741. package/stories/examples/util.js +0 -235
  742. package/tsconfig.build.tsbuildinfo +0 -1
  743. package/ui/AppLogo.d.ts +0 -7
  744. package/ui/AppLogo.js +0 -12
  745. package/ui/AssemblySelector.d.ts +0 -13
  746. package/ui/AssemblySelector.js +0 -46
  747. package/ui/BaseTooltip.d.ts +0 -8
  748. package/ui/BaseTooltip.js +0 -46
  749. package/ui/CascadingMenu.d.ts +0 -9
  750. package/ui/CascadingMenu.js +0 -92
  751. package/ui/CascadingMenuButton.d.ts +0 -11
  752. package/ui/CascadingMenuButton.js +0 -29
  753. package/ui/ColorPicker.js +0 -101
  754. package/ui/DataGridFlexContainer.d.ts +0 -3
  755. package/ui/DataGridFlexContainer.js +0 -15
  756. package/ui/Dialog.d.ts +0 -7
  757. package/ui/Dialog.js +0 -50
  758. package/ui/DraggableDialog.js +0 -32
  759. package/ui/DropDownMenu.d.ts +0 -8
  760. package/ui/DropDownMenu.js +0 -37
  761. package/ui/EditableTypography.js +0 -72
  762. package/ui/ErrorBoundary.d.ts +0 -17
  763. package/ui/ErrorBoundary.js +0 -19
  764. package/ui/ErrorMessage.js +0 -94
  765. package/ui/ErrorMessageStackTraceDialog.js +0 -149
  766. package/ui/ExternalLink.js +0 -13
  767. package/ui/FactoryResetDialog.js +0 -24
  768. package/ui/FatalErrorDialog.js +0 -24
  769. package/ui/FileSelector/FileSelector.d.ts +0 -11
  770. package/ui/FileSelector/FileSelector.js +0 -102
  771. package/ui/FileSelector/LocalFileChooser.d.ts +0 -6
  772. package/ui/FileSelector/LocalFileChooser.js +0 -42
  773. package/ui/FileSelector/UrlChooser.d.ts +0 -8
  774. package/ui/FileSelector/UrlChooser.js +0 -19
  775. package/ui/FileSelector/index.d.ts +0 -1
  776. package/ui/FileSelector/index.js +0 -8
  777. package/ui/HoverMenu.js +0 -50
  778. package/ui/Icons.js +0 -23
  779. package/ui/LoadingEllipses.d.ts +0 -6
  780. package/ui/LoadingEllipses.js +0 -35
  781. package/ui/Logo.js +0 -46
  782. package/ui/Menu.d.ts +0 -53
  783. package/ui/Menu.js +0 -233
  784. package/ui/MenuButton.d.ts +0 -10
  785. package/ui/MenuButton.js +0 -28
  786. package/ui/PrerenderedCanvas.d.ts +0 -10
  787. package/ui/PrerenderedCanvas.js +0 -34
  788. package/ui/RedErrorMessageBox.js +0 -19
  789. package/ui/ResizeHandle.js +0 -72
  790. package/ui/ReturnToImportFormDialog.js +0 -18
  791. package/ui/SanitizedHTML.js +0 -64
  792. package/ui/Snackbar.d.ts +0 -10
  793. package/ui/Snackbar.js +0 -49
  794. package/ui/SnackbarContents.d.ts +0 -5
  795. package/ui/SnackbarContents.js +0 -16
  796. package/ui/SnackbarModel.d.ts +0 -17
  797. package/ui/SnackbarModel.js +0 -96
  798. package/ui/colors.js +0 -78
  799. package/ui/hooks.d.ts +0 -66
  800. package/ui/hooks.js +0 -185
  801. package/ui/index.d.ts +0 -19
  802. package/ui/index.js +0 -56
  803. package/ui/react-colorful.d.ts +0 -17
  804. package/ui/react-colorful.js +0 -466
  805. package/ui/theme.d.ts +0 -59
  806. package/ui/theme.js +0 -381
  807. package/ui/useEvent.js +0 -47
  808. package/util/Base1DUtils.d.ts +0 -38
  809. package/util/Base1DUtils.js +0 -198
  810. package/util/Base1DViewModel.d.ts +0 -61
  811. package/util/Base1DViewModel.js +0 -135
  812. package/util/QuickLRU.d.ts +0 -32
  813. package/util/QuickLRU.js +0 -237
  814. package/util/TimeTraveller.d.ts +0 -19
  815. package/util/TimeTraveller.js +0 -90
  816. package/util/aborting.js +0 -48
  817. package/util/analytics.js +0 -86
  818. package/util/blobToDataURL.js +0 -17
  819. package/util/blockTypes.d.ts +0 -58
  820. package/util/blockTypes.js +0 -110
  821. package/util/calculateDynamicBlocks.d.ts +0 -3
  822. package/util/calculateDynamicBlocks.js +0 -100
  823. package/util/calculateStaticBlocks.d.ts +0 -13
  824. package/util/calculateStaticBlocks.js +0 -102
  825. package/util/cluster.d.ts +0 -17
  826. package/util/cluster.js +0 -96
  827. package/util/color/cssColorsLevel4.js +0 -160
  828. package/util/color/index.d.ts +0 -4
  829. package/util/color/index.js +0 -40
  830. package/util/colord.d.ts +0 -1
  831. package/util/colord.js +0 -13
  832. package/util/compositeMap.d.ts +0 -11
  833. package/util/compositeMap.js +0 -61
  834. package/util/dedupe.js +0 -15
  835. package/util/formatFastaStrings.js +0 -12
  836. package/util/idMaker.js +0 -24
  837. package/util/index.d.ts +0 -274
  838. package/util/index.js +0 -1052
  839. package/util/io/RemoteFileWithRangeCache.js +0 -76
  840. package/util/io/index.d.ts +0 -7
  841. package/util/io/index.js +0 -103
  842. package/util/jexl.d.ts +0 -4
  843. package/util/jexl.js +0 -54
  844. package/util/jexlStrings.js +0 -23
  845. package/util/layouts/BaseLayout.d.ts +0 -30
  846. package/util/layouts/BaseLayout.js +0 -2
  847. package/util/layouts/GranularRectLayout.d.ts +0 -37
  848. package/util/layouts/GranularRectLayout.js +0 -343
  849. package/util/layouts/MultiLayout.d.ts +0 -12
  850. package/util/layouts/MultiLayout.js +0 -42
  851. package/util/layouts/PrecomputedLayout.d.ts +0 -28
  852. package/util/layouts/PrecomputedLayout.js +0 -66
  853. package/util/layouts/PrecomputedMultiLayout.d.ts +0 -4
  854. package/util/layouts/PrecomputedMultiLayout.js +0 -21
  855. package/util/layouts/SceneGraph.js +0 -115
  856. package/util/layouts/index.d.ts +0 -7
  857. package/util/layouts/index.js +0 -31
  858. package/util/makeAbortableReaction.d.ts +0 -2
  859. package/util/makeAbortableReaction.js +0 -50
  860. package/util/map-obj.d.ts +0 -3
  861. package/util/map-obj.js +0 -37
  862. package/util/mst-reflection.d.ts +0 -11
  863. package/util/mst-reflection.js +0 -62
  864. package/util/nanoid.d.ts +0 -5
  865. package/util/nanoid.js +0 -43
  866. package/util/nextTick.js +0 -6
  867. package/util/offscreenCanvasPonyfill.d.ts +0 -7
  868. package/util/offscreenCanvasPonyfill.js +0 -65
  869. package/util/offscreenCanvasUtils.d.ts +0 -28
  870. package/util/offscreenCanvasUtils.js +0 -99
  871. package/util/parseLineByLine.js +0 -25
  872. package/util/range.js +0 -26
  873. package/util/rxjs.d.ts +0 -3
  874. package/util/rxjs.js +0 -21
  875. package/util/simpleFeature.d.ts +0 -44
  876. package/util/simpleFeature.js +0 -82
  877. package/util/stats.d.ts +0 -21
  878. package/util/stats.js +0 -78
  879. package/util/stopToken.d.ts +0 -3
  880. package/util/stopToken.js +0 -29
  881. package/util/tracks.d.ts +0 -55
  882. package/util/tracks.js +0 -168
  883. package/util/types/index.d.ts +0 -254
  884. package/util/types/index.js +0 -172
  885. package/util/types/mst.d.ts +0 -107
  886. package/util/types/mst.js +0 -72
  887. package/util/types/util.d.ts +0 -6
  888. package/util/types/util.js +0 -2
  889. package/util/useMeasure.js +0 -33
  890. package/util/when.js +0 -5
  891. /package/{BaseFeatureWidget → esm/BaseFeatureWidget}/BaseFeatureDetail/ArrayValue.d.ts +0 -0
  892. /package/{BaseFeatureWidget → esm/BaseFeatureWidget}/BaseFeatureDetail/BasicValue.d.ts +0 -0
  893. /package/{BaseFeatureWidget → esm/BaseFeatureWidget}/BaseFeatureDetail/DataGridDetails.d.ts +0 -0
  894. /package/{BaseFeatureWidget → esm/BaseFeatureWidget}/BaseFeatureDetail/FieldName.d.ts +0 -0
  895. /package/{BaseFeatureWidget → esm/BaseFeatureWidget}/BaseFeatureDetail/SimpleField.d.ts +0 -0
  896. /package/{BaseFeatureWidget → esm/BaseFeatureWidget}/BaseFeatureDetail/UriField.d.ts +0 -0
  897. /package/{BaseFeatureWidget → esm/BaseFeatureWidget}/BaseFeatureDetail/util.d.ts +0 -0
  898. /package/{BaseFeatureWidget → esm/BaseFeatureWidget}/SequenceFeatureDetails/dialogs/HelpDialog.d.ts +0 -0
  899. /package/{PhasedScheduler.d.ts → esm/PhasedScheduler.d.ts} +0 -0
  900. /package/{ReExports → esm/ReExports}/BaseFeatureDetails.d.ts +0 -0
  901. /package/{ReExports → esm/ReExports}/DataGrid.d.ts +0 -0
  902. /package/{ReExports → esm/ReExports}/MuiDataGridReExports.d.ts +0 -0
  903. /package/{ReExports → esm/ReExports}/lazify.d.ts +0 -0
  904. /package/{ReExports → esm/ReExports}/list.d.ts +0 -0
  905. /package/{ReExports → esm/ReExports}/modules.d.ts +0 -0
  906. /package/{data_adapters → esm/data_adapters}/util.d.ts +0 -0
  907. /package/{pluggableElementTypes → esm/pluggableElementTypes}/PluggableElementBase.d.ts +0 -0
  908. /package/{pluggableElementTypes → esm/pluggableElementTypes}/renderers/util/serializableFilterChain.d.ts +0 -0
  909. /package/{ui → esm/ui}/ColorPicker.d.ts +0 -0
  910. /package/{ui → esm/ui}/DraggableDialog.d.ts +0 -0
  911. /package/{ui → esm/ui}/EditableTypography.d.ts +0 -0
  912. /package/{ui → esm/ui}/ErrorMessage.d.ts +0 -0
  913. /package/{ui → esm/ui}/ErrorMessageStackTraceDialog.d.ts +0 -0
  914. /package/{ui → esm/ui}/ExternalLink.d.ts +0 -0
  915. /package/{ui → esm/ui}/FactoryResetDialog.d.ts +0 -0
  916. /package/{ui → esm/ui}/FatalErrorDialog.d.ts +0 -0
  917. /package/{ui → esm/ui}/HoverMenu.d.ts +0 -0
  918. /package/{ui → esm/ui}/Icons.d.ts +0 -0
  919. /package/{ui → esm/ui}/Logo.d.ts +0 -0
  920. /package/{ui → esm/ui}/RedErrorMessageBox.d.ts +0 -0
  921. /package/{ui → esm/ui}/ResizeHandle.d.ts +0 -0
  922. /package/{ui → esm/ui}/ReturnToImportFormDialog.d.ts +0 -0
  923. /package/{ui → esm/ui}/SanitizedHTML.d.ts +0 -0
  924. /package/{ui → esm/ui}/colors.d.ts +0 -0
  925. /package/{ui → esm/ui}/useEvent.d.ts +0 -0
  926. /package/{util → esm/util}/aborting.d.ts +0 -0
  927. /package/{util → esm/util}/analytics.d.ts +0 -0
  928. /package/{util → esm/util}/blobToDataURL.d.ts +0 -0
  929. /package/{util → esm/util}/color/cssColorsLevel4.d.ts +0 -0
  930. /package/{util → esm/util}/dedupe.d.ts +0 -0
  931. /package/{util → esm/util}/formatFastaStrings.d.ts +0 -0
  932. /package/{util → esm/util}/idMaker.d.ts +0 -0
  933. /package/{util → esm/util}/io/RemoteFileWithRangeCache.d.ts +0 -0
  934. /package/{util → esm/util}/jexlStrings.d.ts +0 -0
  935. /package/{util → esm/util}/layouts/SceneGraph.d.ts +0 -0
  936. /package/{util → esm/util}/nextTick.d.ts +0 -0
  937. /package/{util → esm/util}/parseLineByLine.d.ts +0 -0
  938. /package/{util → esm/util}/range.d.ts +0 -0
  939. /package/{util → esm/util}/useMeasure.d.ts +0 -0
  940. /package/{util → esm/util}/when.d.ts +0 -0
@@ -0,0 +1,873 @@
1
+ import { useEffect, useRef, useState } from 'react';
2
+ import { unzip } from '@gmod/bgzf-filehandle';
3
+ import useMeasure from '@jbrowse/core/util/useMeasure';
4
+ import { getEnv as getEnvMST, getParent, getSnapshot, hasParent, isAlive, isStateTreeNode, } from '@jbrowse/mobx-state-tree';
5
+ import { flushSync } from 'react-dom';
6
+ import { createRoot } from 'react-dom/client';
7
+ import { coarseStripHTML } from "./coarseStripHTML.js";
8
+ import { colord } from "./colord.js";
9
+ import { parseLocString } from "./locString.js";
10
+ import { checkStopToken } from "./stopToken.js";
11
+ import { isDisplayModel, isSessionModel, isTrackModel, isUriLocation, isViewModel, } from "./types/index.js";
12
+ export * from "./types/index.js";
13
+ export * from "./when.js";
14
+ export * from "./range.js";
15
+ export * from "./dedupe.js";
16
+ export * from "./coarseStripHTML.js";
17
+ export * from "./offscreenCanvasPonyfill.js";
18
+ export * from "./offscreenCanvasUtils.js";
19
+ export * from "./rpc.js";
20
+ const containingDisplayCache = new WeakMap();
21
+ const containingTrackCache = new WeakMap();
22
+ const containingViewCache = new WeakMap();
23
+ const sessionCache = new WeakMap();
24
+ export function useDebounce(value, delay) {
25
+ const [debouncedValue, setDebouncedValue] = useState(value);
26
+ useEffect(() => {
27
+ const handle = setTimeout(() => {
28
+ setDebouncedValue(value);
29
+ }, delay);
30
+ return () => {
31
+ clearTimeout(handle);
32
+ };
33
+ }, [value, delay]);
34
+ return debouncedValue;
35
+ }
36
+ export function useWidthSetter(view, padding) {
37
+ const [ref, { width }] = useMeasure();
38
+ useEffect(() => {
39
+ let token;
40
+ if (width && isAlive(view)) {
41
+ token = requestAnimationFrame(() => {
42
+ view.setWidth(width);
43
+ });
44
+ }
45
+ return () => {
46
+ if (token) {
47
+ cancelAnimationFrame(token);
48
+ }
49
+ };
50
+ }, [padding, view, width]);
51
+ return ref;
52
+ }
53
+ export function useDebouncedCallback(callback, wait = 400) {
54
+ const argsRef = useRef(null);
55
+ const timeout = useRef(null);
56
+ useEffect(() => {
57
+ if (timeout.current) {
58
+ clearTimeout(timeout.current);
59
+ }
60
+ }, []);
61
+ return function debouncedCallback(...args) {
62
+ argsRef.current = args;
63
+ if (timeout.current) {
64
+ clearTimeout(timeout.current);
65
+ }
66
+ timeout.current = setTimeout(() => {
67
+ if (argsRef.current) {
68
+ callback(...argsRef.current);
69
+ }
70
+ }, wait);
71
+ };
72
+ }
73
+ export function findParentThat(node, predicate) {
74
+ if (!hasParent(node)) {
75
+ throw new Error('node does not have parent');
76
+ }
77
+ let currentNode = getParent(node);
78
+ while (currentNode && isAlive(currentNode)) {
79
+ if (predicate(currentNode)) {
80
+ return currentNode;
81
+ }
82
+ if (hasParent(currentNode)) {
83
+ currentNode = getParent(currentNode);
84
+ }
85
+ else {
86
+ break;
87
+ }
88
+ }
89
+ throw new Error('no matching node found');
90
+ }
91
+ export function springAnimate(fromValue, toValue, setValue, onFinish = () => { }, precision = 0, tension = 400, friction = 20, clamp = true) {
92
+ const mass = 1;
93
+ if (!precision) {
94
+ precision = Math.abs(toValue - fromValue) / 1000;
95
+ }
96
+ let animationFrameId;
97
+ function update(animation) {
98
+ const time = performance.now();
99
+ let position = animation.lastPosition;
100
+ let lastTime = animation.lastTime || time;
101
+ let velocity = animation.lastVelocity || 0;
102
+ if (time > lastTime + 64) {
103
+ lastTime = time;
104
+ }
105
+ const numSteps = Math.floor(time - lastTime);
106
+ for (let i = 0; i < numSteps; ++i) {
107
+ const force = -tension * (position - toValue);
108
+ const damping = -friction * velocity;
109
+ const acceleration = (force + damping) / mass;
110
+ velocity += (acceleration * 1) / 1000;
111
+ position += (velocity * 1) / 1000;
112
+ }
113
+ const isVelocity = Math.abs(velocity) <= precision;
114
+ const isDisplacement = tension !== 0 ? Math.abs(toValue - position) <= precision : true;
115
+ const isOvershooting = clamp && tension !== 0
116
+ ? fromValue < toValue
117
+ ? position > toValue
118
+ : position < toValue
119
+ : false;
120
+ const endOfAnimation = isOvershooting || (isVelocity && isDisplacement);
121
+ if (endOfAnimation) {
122
+ setValue(toValue);
123
+ onFinish();
124
+ }
125
+ else {
126
+ setValue(position);
127
+ animationFrameId = requestAnimationFrame(() => {
128
+ update({
129
+ lastPosition: position,
130
+ lastTime: time,
131
+ lastVelocity: velocity,
132
+ });
133
+ });
134
+ }
135
+ }
136
+ return [
137
+ () => {
138
+ update({ lastPosition: fromValue });
139
+ },
140
+ () => {
141
+ cancelAnimationFrame(animationFrameId);
142
+ },
143
+ ];
144
+ }
145
+ export function findParentThatIs(node, predicate) {
146
+ return findParentThat(node, predicate);
147
+ }
148
+ export function getSession(node) {
149
+ const cached = sessionCache.get(node);
150
+ if (cached && isAlive(cached)) {
151
+ return cached;
152
+ }
153
+ try {
154
+ const result = findParentThatIs(node, isSessionModel);
155
+ sessionCache.set(node, result);
156
+ return result;
157
+ }
158
+ catch (e) {
159
+ throw new Error('no session model found!');
160
+ }
161
+ }
162
+ export function getContainingView(node) {
163
+ const cached = containingViewCache.get(node);
164
+ if (cached && isAlive(cached)) {
165
+ return cached;
166
+ }
167
+ try {
168
+ const result = findParentThatIs(node, isViewModel);
169
+ containingViewCache.set(node, result);
170
+ return result;
171
+ }
172
+ catch (e) {
173
+ throw new Error('no containing view found');
174
+ }
175
+ }
176
+ export function getContainingTrack(node) {
177
+ const cached = containingTrackCache.get(node);
178
+ if (cached && isAlive(cached)) {
179
+ return cached;
180
+ }
181
+ try {
182
+ const result = findParentThatIs(node, isTrackModel);
183
+ containingTrackCache.set(node, result);
184
+ return result;
185
+ }
186
+ catch (e) {
187
+ throw new Error('no containing track found');
188
+ }
189
+ }
190
+ export function getContainingDisplay(node) {
191
+ const cached = containingDisplayCache.get(node);
192
+ if (cached && isAlive(cached)) {
193
+ return cached;
194
+ }
195
+ try {
196
+ const result = findParentThatIs(node, isDisplayModel);
197
+ containingDisplayCache.set(node, result);
198
+ return result;
199
+ }
200
+ catch (e) {
201
+ throw new Error('no containing display found');
202
+ }
203
+ }
204
+ export function assembleLocString(region) {
205
+ return assembleLocStringFast(region, toLocale);
206
+ }
207
+ export function assembleLocStringFast(region, cb = (n) => n) {
208
+ const { assemblyName, refName, start, end, reversed } = region;
209
+ const assemblyNameString = assemblyName ? `{${assemblyName}}` : '';
210
+ let startString;
211
+ if (start !== undefined) {
212
+ startString = `:${cb(start + 1)}`;
213
+ }
214
+ else if (end !== undefined) {
215
+ startString = ':1';
216
+ }
217
+ else {
218
+ startString = '';
219
+ }
220
+ let endString;
221
+ if (end !== undefined) {
222
+ endString = start !== undefined && start + 1 === end ? '' : `..${cb(end)}`;
223
+ }
224
+ else {
225
+ endString = start !== undefined ? '..' : '';
226
+ }
227
+ let rev = '';
228
+ if (reversed) {
229
+ rev = '[rev]';
230
+ }
231
+ return `${assemblyNameString}${refName}${startString}${endString}${rev}`;
232
+ }
233
+ export function compareLocs(locA, locB) {
234
+ const assemblyComp = locA.assemblyName || locB.assemblyName
235
+ ? (locA.assemblyName || '').localeCompare(locB.assemblyName || '')
236
+ : 0;
237
+ if (assemblyComp) {
238
+ return assemblyComp;
239
+ }
240
+ const refComp = locA.refName || locB.refName
241
+ ? (locA.refName || '').localeCompare(locB.refName || '')
242
+ : 0;
243
+ if (refComp) {
244
+ return refComp;
245
+ }
246
+ if (locA.start !== undefined && locB.start !== undefined) {
247
+ const startComp = locA.start - locB.start;
248
+ if (startComp) {
249
+ return startComp;
250
+ }
251
+ }
252
+ if (locA.end !== undefined && locB.end !== undefined) {
253
+ const endComp = locA.end - locB.end;
254
+ if (endComp) {
255
+ return endComp;
256
+ }
257
+ }
258
+ return 0;
259
+ }
260
+ export function compareLocStrings(a, b, isValidRefName) {
261
+ const locA = parseLocString(a, isValidRefName);
262
+ const locB = parseLocString(b, isValidRefName);
263
+ return compareLocs(locA, locB);
264
+ }
265
+ export function clamp(num, min, max) {
266
+ if (num < min) {
267
+ return min;
268
+ }
269
+ if (num > max) {
270
+ return max;
271
+ }
272
+ return num;
273
+ }
274
+ function roundToNearestPointOne(num) {
275
+ return Math.round(num * 10) / 10;
276
+ }
277
+ export function bpToPx(bp, { reversed, end = 0, start = 0, }, bpPerPx) {
278
+ return roundToNearestPointOne((reversed ? end - bp : bp - start) / bpPerPx);
279
+ }
280
+ const oneEightyOverPi = 180 / Math.PI;
281
+ const piOverOneEighty = Math.PI / 180;
282
+ export function radToDeg(radians) {
283
+ return (radians * oneEightyOverPi) % 360;
284
+ }
285
+ export function degToRad(degrees) {
286
+ return (degrees * piOverOneEighty) % (2 * Math.PI);
287
+ }
288
+ export function polarToCartesian(rho, theta) {
289
+ return [rho * Math.cos(theta), rho * Math.sin(theta)];
290
+ }
291
+ export function cartesianToPolar(x, y) {
292
+ const rho = Math.sqrt(x * x + y * y);
293
+ const theta = Math.atan(y / x);
294
+ return [rho, theta];
295
+ }
296
+ export function featureSpanPx(feature, region, bpPerPx) {
297
+ return bpSpanPx(feature.get('start'), feature.get('end'), region, bpPerPx);
298
+ }
299
+ export function bpSpanPx(leftBp, rightBp, region, bpPerPx) {
300
+ const start = bpToPx(leftBp, region, bpPerPx);
301
+ const end = bpToPx(rightBp, region, bpPerPx);
302
+ return region.reversed ? [end, start] : [start, end];
303
+ }
304
+ export function calculateLayoutBounds(featureStart, featureEnd, layoutWidthBp, reversed) {
305
+ const featureWidthBp = featureEnd - featureStart;
306
+ const labelOverhangBp = Math.max(0, layoutWidthBp - featureWidthBp);
307
+ return reversed
308
+ ? [featureStart - labelOverhangBp, featureEnd]
309
+ : [featureStart, featureStart + layoutWidthBp];
310
+ }
311
+ export function iterMap(iter, func, sizeHint) {
312
+ const results = Array.from({ length: sizeHint || 0 });
313
+ let counter = 0;
314
+ for (const item of iter) {
315
+ results[counter] = func(item);
316
+ counter += 1;
317
+ }
318
+ return results;
319
+ }
320
+ export function findLastIndex(array, predicate) {
321
+ let l = array.length;
322
+ while (l--) {
323
+ if (predicate(array[l], l, array)) {
324
+ return l;
325
+ }
326
+ }
327
+ return -1;
328
+ }
329
+ export function findLast(array, predicate) {
330
+ let l = array.length;
331
+ while (l--) {
332
+ if (predicate(array[l], l, array)) {
333
+ return array[l];
334
+ }
335
+ }
336
+ return undefined;
337
+ }
338
+ export function renameRegionIfNeeded(refNameMap, region) {
339
+ if (isStateTreeNode(region) && !isAlive(region)) {
340
+ return region;
341
+ }
342
+ if (refNameMap?.[region.refName]) {
343
+ region = isStateTreeNode(region)
344
+ ? { ...getSnapshot(region) }
345
+ : { ...region };
346
+ const newRef = refNameMap[region.refName];
347
+ if (newRef) {
348
+ return {
349
+ ...region,
350
+ refName: newRef,
351
+ originalRefName: region.refName,
352
+ };
353
+ }
354
+ }
355
+ return region;
356
+ }
357
+ export async function renameRegionsIfNeeded(assemblyManager, args) {
358
+ const { regions = [], adapterConfig } = args;
359
+ if (!args.sessionId) {
360
+ throw new Error('sessionId is required');
361
+ }
362
+ const assemblyNames = regions.map(region => region.assemblyName);
363
+ const assemblyMaps = Object.fromEntries(await Promise.all([...new Set(assemblyNames)].map(async (assemblyName) => {
364
+ return [
365
+ assemblyName,
366
+ await assemblyManager.getRefNameMapForAdapter(adapterConfig, assemblyName, args),
367
+ ];
368
+ })));
369
+ return {
370
+ ...args,
371
+ regions: regions.map((region, i) => renameRegionIfNeeded(assemblyMaps[assemblyNames[i]], region)),
372
+ };
373
+ }
374
+ export function minmax(a, b) {
375
+ return [Math.min(a, b), Math.max(a, b)];
376
+ }
377
+ export function shorten(name, max = 70, short = 30) {
378
+ return name.length > max
379
+ ? `${name.slice(0, short)}...${name.slice(-short)}`
380
+ : name;
381
+ }
382
+ export function shorten2(name, max = 70) {
383
+ return name.length > max ? `${name.slice(0, max)}...` : name;
384
+ }
385
+ export function stringify({ refName, coord, assemblyName, oob, }, useAssemblyName) {
386
+ return [
387
+ assemblyName && useAssemblyName ? `{${assemblyName}}` : '',
388
+ refName
389
+ ? `${shorten(refName)}:${toLocale(coord)}${oob ? ' (out of bounds)' : ''}`
390
+ : '',
391
+ ].join('');
392
+ }
393
+ export const isElectron = /electron/i.test(typeof navigator !== 'undefined' ? navigator.userAgent : '');
394
+ export const complementTable = {
395
+ S: 'S',
396
+ w: 'w',
397
+ T: 'A',
398
+ r: 'y',
399
+ a: 't',
400
+ N: 'N',
401
+ K: 'M',
402
+ x: 'x',
403
+ d: 'h',
404
+ Y: 'R',
405
+ V: 'B',
406
+ y: 'r',
407
+ M: 'K',
408
+ h: 'd',
409
+ k: 'm',
410
+ C: 'G',
411
+ g: 'c',
412
+ t: 'a',
413
+ A: 'T',
414
+ n: 'n',
415
+ W: 'W',
416
+ X: 'X',
417
+ m: 'k',
418
+ v: 'b',
419
+ B: 'V',
420
+ s: 's',
421
+ H: 'D',
422
+ c: 'g',
423
+ D: 'H',
424
+ b: 'v',
425
+ R: 'Y',
426
+ G: 'C',
427
+ };
428
+ export function revcom(str) {
429
+ const revcomped = [];
430
+ for (let i = str.length - 1; i >= 0; i--) {
431
+ revcomped.push(complementTable[str[i]] ?? str[i]);
432
+ }
433
+ return revcomped.join('');
434
+ }
435
+ export function reverse(str) {
436
+ const reversed = [];
437
+ for (let i = str.length - 1; i >= 0; i--) {
438
+ reversed.push(str[i]);
439
+ }
440
+ return reversed.join('');
441
+ }
442
+ export function complement(str) {
443
+ const comp = [];
444
+ for (let i = 0, l = str.length; i < l; i++) {
445
+ comp.push(complementTable[str[i]] ?? str[i]);
446
+ }
447
+ return comp.join('');
448
+ }
449
+ export const rIC = typeof jest === 'undefined'
450
+ ?
451
+ typeof window !== 'undefined' && window.requestIdleCallback
452
+ ? window.requestIdleCallback
453
+ : (cb) => setTimeout(() => {
454
+ cb();
455
+ }, 1)
456
+ : (cb) => {
457
+ cb();
458
+ };
459
+ const widths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2796875, 0.2765625, 0.3546875, 0.5546875, 0.5546875, 0.8890625, 0.665625, 0.190625, 0.3328125, 0.3328125, 0.3890625, 0.5828125, 0.2765625, 0.3328125, 0.2765625, 0.3015625, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.2765625, 0.2765625, 0.584375, 0.5828125, 0.584375, 0.5546875, 1.0140625, 0.665625, 0.665625, 0.721875, 0.721875, 0.665625, 0.609375, 0.7765625, 0.721875, 0.2765625, 0.5, 0.665625, 0.5546875, 0.8328125, 0.721875, 0.7765625, 0.665625, 0.7765625, 0.721875, 0.665625, 0.609375, 0.721875, 0.665625, 0.94375, 0.665625, 0.665625, 0.609375, 0.2765625, 0.3546875, 0.2765625, 0.4765625, 0.5546875, 0.3328125, 0.5546875, 0.5546875, 0.5, 0.5546875, 0.5546875, 0.2765625, 0.5546875, 0.5546875, 0.221875, 0.240625, 0.5, 0.221875, 0.8328125, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.3328125, 0.5, 0.2765625, 0.5546875, 0.5, 0.721875, 0.5, 0.5, 0.5, 0.3546875, 0.259375, 0.353125, 0.5890625];
460
+ const avgWidth = 0.5279276315789471;
461
+ export function measureText(str, fontSize = 10) {
462
+ const s = String(str);
463
+ let total = 0;
464
+ for (let i = 0, l = s.length; i < l; i++) {
465
+ total += widths[s.charCodeAt(i)] ?? avgWidth;
466
+ }
467
+ return total * fontSize;
468
+ }
469
+ export function getFrame(start, end, strand, phase) {
470
+ return strand === 1
471
+ ? (((start + phase) % 3) + 1)
472
+ : (-1 * ((end - phase) % 3) - 1);
473
+ }
474
+ export const defaultStarts = ['ATG'];
475
+ export const defaultStops = ['TAA', 'TAG', 'TGA'];
476
+ export const defaultCodonTable = {
477
+ TCA: 'S',
478
+ TCC: 'S',
479
+ TCG: 'S',
480
+ TCT: 'S',
481
+ TTC: 'F',
482
+ TTT: 'F',
483
+ TTA: 'L',
484
+ TTG: 'L',
485
+ TAC: 'Y',
486
+ TAT: 'Y',
487
+ TAA: '*',
488
+ TAG: '*',
489
+ TGC: 'C',
490
+ TGT: 'C',
491
+ TGA: '*',
492
+ TGG: 'W',
493
+ CTA: 'L',
494
+ CTC: 'L',
495
+ CTG: 'L',
496
+ CTT: 'L',
497
+ CCA: 'P',
498
+ CCC: 'P',
499
+ CCG: 'P',
500
+ CCT: 'P',
501
+ CAC: 'H',
502
+ CAT: 'H',
503
+ CAA: 'Q',
504
+ CAG: 'Q',
505
+ CGA: 'R',
506
+ CGC: 'R',
507
+ CGG: 'R',
508
+ CGT: 'R',
509
+ ATA: 'I',
510
+ ATC: 'I',
511
+ ATT: 'I',
512
+ ATG: 'M',
513
+ ACA: 'T',
514
+ ACC: 'T',
515
+ ACG: 'T',
516
+ ACT: 'T',
517
+ AAC: 'N',
518
+ AAT: 'N',
519
+ AAA: 'K',
520
+ AAG: 'K',
521
+ AGC: 'S',
522
+ AGT: 'S',
523
+ AGA: 'R',
524
+ AGG: 'R',
525
+ GTA: 'V',
526
+ GTC: 'V',
527
+ GTG: 'V',
528
+ GTT: 'V',
529
+ GCA: 'A',
530
+ GCC: 'A',
531
+ GCG: 'A',
532
+ GCT: 'A',
533
+ GAC: 'D',
534
+ GAT: 'D',
535
+ GAA: 'E',
536
+ GAG: 'E',
537
+ GGA: 'G',
538
+ GGC: 'G',
539
+ GGG: 'G',
540
+ GGT: 'G',
541
+ };
542
+ export function generateCodonTable(table) {
543
+ const tempCodonTable = {};
544
+ for (const codon of Object.keys(table)) {
545
+ const aa = table[codon];
546
+ const nucs = [];
547
+ for (let i = 0; i < 3; i++) {
548
+ const nuc = codon.charAt(i);
549
+ nucs[i] = [];
550
+ nucs[i][0] = nuc.toUpperCase();
551
+ nucs[i][1] = nuc.toLowerCase();
552
+ }
553
+ for (let i = 0; i < 2; i++) {
554
+ const n0 = nucs[0][i];
555
+ for (let j = 0; j < 2; j++) {
556
+ const n1 = nucs[1][j];
557
+ for (let k = 0; k < 2; k++) {
558
+ const n2 = nucs[2][k];
559
+ const triplet = n0 + n1 + n2;
560
+ tempCodonTable[triplet] = aa;
561
+ }
562
+ }
563
+ }
564
+ }
565
+ return tempCodonTable;
566
+ }
567
+ export async function updateStatus(msg, cb, fn) {
568
+ cb?.(msg);
569
+ const res = await fn();
570
+ cb?.('');
571
+ return res;
572
+ }
573
+ export async function updateStatus2(msg, cb, stopToken, fn) {
574
+ cb(msg);
575
+ const res = await fn();
576
+ checkStopToken(stopToken);
577
+ cb('');
578
+ return res;
579
+ }
580
+ export function hashCode(str) {
581
+ let hash = 0;
582
+ if (str.length === 0) {
583
+ return hash;
584
+ }
585
+ for (let i = 0; i < str.length; i++) {
586
+ const chr = str.charCodeAt(i);
587
+ hash = (hash << 5) - hash + chr;
588
+ hash |= 0;
589
+ }
590
+ return hash;
591
+ }
592
+ export function objectHash(obj) {
593
+ return `${hashCode(JSON.stringify(obj))}`;
594
+ }
595
+ export async function bytesForRegions(regions, index) {
596
+ const blockResults = await Promise.all(regions.map(r => index.blocksForRange(r.refName, r.start, r.end)));
597
+ return sum(blockResults
598
+ .flat()
599
+ .map(block => block.maxv.blockPosition + 65535 - block.minv.blockPosition));
600
+ }
601
+ export function isSupportedIndexingAdapter(type = '') {
602
+ return [
603
+ 'Gff3TabixAdapter',
604
+ 'VcfTabixAdapter',
605
+ 'Gff3Adapter',
606
+ 'VcfAdapter',
607
+ ].includes(type);
608
+ }
609
+ export function getBpDisplayStr(total) {
610
+ if (Math.floor(total / 1_000_000) > 0) {
611
+ return `${reducePrecision(total / 1_000_000)}Mbp`;
612
+ }
613
+ else if (Math.floor(total / 1_000) > 0) {
614
+ return `${reducePrecision(total / 1_000)}Kbp`;
615
+ }
616
+ else {
617
+ return `${Math.floor(total)}bp`;
618
+ }
619
+ }
620
+ export function reducePrecision(s, n = 3) {
621
+ return toLocale(Number.parseFloat(s.toPrecision(n)));
622
+ }
623
+ export function getProgressDisplayStr(current, total) {
624
+ if (Math.floor(total / 1_000_000) > 0) {
625
+ return `${reducePrecision(current / 1_000_000)}/${reducePrecision(total / 1_000_000)}Mb`;
626
+ }
627
+ else if (Math.floor(total / 1_000) > 0) {
628
+ return `${reducePrecision(current / 1_000)}/${reducePrecision(total / 1_000)}Kb`;
629
+ }
630
+ else {
631
+ return `${reducePrecision(current)}/${reducePrecision(total)} bytes`;
632
+ }
633
+ }
634
+ export function toLocale(n) {
635
+ if (n < 1000) {
636
+ return String(n);
637
+ }
638
+ const str = String(n);
639
+ const len = str.length;
640
+ let result = '';
641
+ for (let i = 0; i < len; i++) {
642
+ if (i > 0 && (len - i) % 3 === 0) {
643
+ result += ',';
644
+ }
645
+ result += str[i];
646
+ }
647
+ return result;
648
+ }
649
+ export function getTickDisplayStr(totalBp, bpPerPx) {
650
+ return Math.floor(bpPerPx / 1_000) > 0
651
+ ? `${toLocale(Number.parseFloat((totalBp / 1_000_000).toFixed(2)))}M`
652
+ : toLocale(Math.floor(totalBp));
653
+ }
654
+ export function getLayoutId({ sessionId, trackInstanceId, }) {
655
+ return `${sessionId}-${trackInstanceId}`;
656
+ }
657
+ export function getStatsId({ sessionId, trackInstanceId, }) {
658
+ return `${sessionId}-${trackInstanceId}`;
659
+ }
660
+ export function useLocalStorage(key, initialValue, enabled = true) {
661
+ const [storedValue, setStoredValue] = useState(() => {
662
+ if (typeof window === 'undefined' || !enabled) {
663
+ return initialValue;
664
+ }
665
+ try {
666
+ const item = window.localStorage.getItem(key);
667
+ return item ? JSON.parse(item) : initialValue;
668
+ }
669
+ catch (error) {
670
+ console.error(error);
671
+ return initialValue;
672
+ }
673
+ });
674
+ const setValue = (value) => {
675
+ try {
676
+ const valueToStore = value instanceof Function ? value(storedValue) : value;
677
+ setStoredValue(valueToStore);
678
+ if (typeof window !== 'undefined' && enabled) {
679
+ window.localStorage.setItem(key, JSON.stringify(valueToStore));
680
+ }
681
+ }
682
+ catch (error) {
683
+ console.error(error);
684
+ }
685
+ };
686
+ return [storedValue, setValue];
687
+ }
688
+ export function getUriLink(value) {
689
+ const { uri, baseUri = '' } = value;
690
+ let href;
691
+ try {
692
+ href = new URL(uri, baseUri).href;
693
+ }
694
+ catch (e) {
695
+ href = uri;
696
+ }
697
+ return href;
698
+ }
699
+ export function getStr(obj) {
700
+ return isObject(obj)
701
+ ? isUriLocation(obj)
702
+ ? getUriLink(obj)
703
+ : JSON.stringify(obj)
704
+ : String(obj);
705
+ }
706
+ export function linkify(s) {
707
+ const pattern = /(^|[\s\n]|<[A-Za-z]*\/?>)((?:https?|ftp):\/\/[-A-Z0-9+\u0026\u2019@#/%?=()~_|!:,.;]*[-A-Z0-9+\u0026@#/%=~()_|])/gi;
708
+ return s.replaceAll(pattern, '$1<a href=\'$2\' target="_blank">$2</a>');
709
+ }
710
+ export function measureGridWidth(elements, args) {
711
+ const { padding = 30, minWidth = 80, fontSize = 12, maxWidth = 1000, stripHTML = false, } = args || {};
712
+ return max(elements
713
+ .map(element => getStr(element))
714
+ .map(str => (stripHTML ? coarseStripHTML(str) : str))
715
+ .map(str => measureText(str, fontSize))
716
+ .map(n => Math.min(Math.max(n + padding, minWidth), maxWidth)));
717
+ }
718
+ export function getEnv(obj) {
719
+ return getEnvMST(obj);
720
+ }
721
+ export function localStorageGetItem(item) {
722
+ return typeof localStorage !== 'undefined'
723
+ ? localStorage.getItem(item)
724
+ : undefined;
725
+ }
726
+ export function localStorageSetItem(str, item) {
727
+ if (typeof localStorage !== 'undefined') {
728
+ localStorage.setItem(str, item);
729
+ }
730
+ }
731
+ export function max(arr, init = Number.NEGATIVE_INFINITY) {
732
+ let max = init;
733
+ for (const entry of arr) {
734
+ max = Math.max(entry, max);
735
+ }
736
+ return max;
737
+ }
738
+ export function min(arr, init = Number.POSITIVE_INFINITY) {
739
+ let min = init;
740
+ for (const entry of arr) {
741
+ min = Math.min(entry, min);
742
+ }
743
+ return min;
744
+ }
745
+ export function sum(arr) {
746
+ let sum = 0;
747
+ for (const entry of arr) {
748
+ sum += entry;
749
+ }
750
+ return sum;
751
+ }
752
+ export function avg(arr) {
753
+ return sum(arr) / arr.length;
754
+ }
755
+ export function groupBy(array, predicate) {
756
+ const result = {};
757
+ for (const value of array) {
758
+ const t = predicate(value);
759
+ if (!result[t]) {
760
+ result[t] = [];
761
+ }
762
+ result[t].push(value);
763
+ }
764
+ return result;
765
+ }
766
+ export function notEmpty(value) {
767
+ return value !== null && value !== undefined;
768
+ }
769
+ export function mergeIntervals(intervals, w = 5000) {
770
+ if (intervals.length <= 1) {
771
+ return intervals;
772
+ }
773
+ const stack = [];
774
+ let top = null;
775
+ intervals = intervals.sort((a, b) => a.start - b.start);
776
+ stack.push(intervals[0]);
777
+ for (let i = 1; i < intervals.length; i++) {
778
+ top = stack.at(-1);
779
+ if (top.end + w < intervals[i].start - w) {
780
+ stack.push(intervals[i]);
781
+ }
782
+ else if (top.end < intervals[i].end) {
783
+ top.end = Math.max(top.end, intervals[i].end);
784
+ stack.pop();
785
+ stack.push(top);
786
+ }
787
+ }
788
+ return stack;
789
+ }
790
+ export function gatherOverlaps(regions, w = 5000) {
791
+ const memo = {};
792
+ for (const x of regions) {
793
+ if (!memo[x.refName]) {
794
+ memo[x.refName] = [];
795
+ }
796
+ memo[x.refName].push(x);
797
+ }
798
+ return Object.values(memo).flatMap(group => mergeIntervals(group.sort((a, b) => a.start - b.start), w));
799
+ }
800
+ export function stripAlpha(str) {
801
+ return colord(str).alpha(1).toHex();
802
+ }
803
+ export function getStrokeProps(str) {
804
+ if (str) {
805
+ const c = colord(str);
806
+ return {
807
+ strokeOpacity: c.alpha(),
808
+ stroke: c.alpha(1).toHex(),
809
+ };
810
+ }
811
+ else {
812
+ return {};
813
+ }
814
+ }
815
+ export function getFillProps(str) {
816
+ if (str) {
817
+ const c = colord(str);
818
+ return {
819
+ fillOpacity: c.alpha(),
820
+ fill: c.alpha(1).toHex(),
821
+ };
822
+ }
823
+ else {
824
+ return {};
825
+ }
826
+ }
827
+ export function renderToStaticMarkup(node) {
828
+ const div = document.createElement('div');
829
+ flushSync(() => {
830
+ createRoot(div).render(node);
831
+ });
832
+ return div.innerHTML.replaceAll(/\brgba\((.+?),[^,]+?\)/g, 'rgb($1)');
833
+ }
834
+ export function isGzip(buf) {
835
+ return buf[0] === 31 && buf[1] === 139 && buf[2] === 8;
836
+ }
837
+ export async function fetchAndMaybeUnzip(loc, opts = {}) {
838
+ const { statusCallback = () => { } } = opts;
839
+ const buf = await updateStatus('Downloading file', statusCallback, () => loc.readFile(opts));
840
+ return isGzip(buf)
841
+ ? await updateStatus('Unzipping', statusCallback, () => unzip(buf))
842
+ : buf;
843
+ }
844
+ export async function fetchAndMaybeUnzipText(loc, opts) {
845
+ const buffer = await fetchAndMaybeUnzip(loc, opts);
846
+ if (buffer.length > 536_870_888) {
847
+ throw new Error('Data exceeds maximum string length (512MB)');
848
+ }
849
+ return new TextDecoder('utf8', { fatal: true }).decode(buffer);
850
+ }
851
+ export function isObject(x) {
852
+ return typeof x === 'object' && x !== null;
853
+ }
854
+ export function localStorageGetNumber(key, defaultVal) {
855
+ return +(localStorageGetItem(key) ?? defaultVal);
856
+ }
857
+ export function localStorageGetBoolean(key, defaultVal) {
858
+ return Boolean(JSON.parse(localStorageGetItem(key) || JSON.stringify(defaultVal)));
859
+ }
860
+ export function localStorageSetBoolean(key, value) {
861
+ localStorageSetItem(key, JSON.stringify(value));
862
+ }
863
+ export function testAdapter(fileName, regex, adapterHint, expected) {
864
+ return (regex.test(fileName) && !adapterHint) || adapterHint === expected;
865
+ }
866
+ export { default as SimpleFeature, isFeature, } from "./simpleFeature.js";
867
+ export { blobToDataURL } from "./blobToDataURL.js";
868
+ export { makeAbortableReaction } from "./makeAbortableReaction.js";
869
+ export * from "./aborting.js";
870
+ export * from "./linkify.js";
871
+ export * from "./locString.js";
872
+ export * from "./stopToken.js";
873
+ export * from "./tracks.js";