@datagrok/helm 2.13.8 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (360) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/css/helm.css +40 -0
  3. package/dist/137.js +2 -0
  4. package/dist/137.js.map +1 -0
  5. package/dist/323.js +2 -0
  6. package/dist/323.js.map +1 -0
  7. package/dist/657.js +2 -0
  8. package/dist/657.js.map +1 -0
  9. package/dist/782.js +2 -0
  10. package/dist/782.js.map +1 -0
  11. package/dist/884.js +2 -0
  12. package/dist/884.js.map +1 -0
  13. package/dist/94.js +2 -0
  14. package/dist/94.js.map +1 -0
  15. package/dist/libraries_bio_src_monomer-works_seq-to-molfile-worker_ts.js +16420 -0
  16. package/dist/libraries_bio_src_monomer-works_seq-to-molfile-worker_ts.js.map +1 -0
  17. package/dist/package-test.js +1 -1
  18. package/dist/package-test.js.map +1 -1
  19. package/dist/package.js +1 -1
  20. package/dist/package.js.map +1 -1
  21. package/dist/vendors-HELM_node_modules_lru-cache_dist_esm_index_js.js +1560 -0
  22. package/dist/vendors-HELM_node_modules_lru-cache_dist_esm_index_js.js.map +1 -0
  23. package/files/samples/helm-showcase.csv +56 -0
  24. package/package.json +8 -12
  25. package/src/helm-helper.ts +134 -410
  26. package/src/package-api.ts +14 -11
  27. package/src/package-test.ts +0 -2
  28. package/src/package-utils.ts +8 -298
  29. package/src/package.g.ts +2 -8
  30. package/src/package.ts +11 -31
  31. package/src/tests/helm-activity-cliffs.ts +2 -2
  32. package/src/tests/helm-input-tests.ts +83 -0
  33. package/src/tests/parse-helm-tests.ts +7 -57
  34. package/src/tests/properties-widget-tests.ts +21 -11
  35. package/src/utils/helm-grid-cell-renderer.ts +141 -151
  36. package/src/utils/index.ts +3 -7
  37. package/src/widgets/helm-input.ts +42 -12
  38. package/src/widgets/properties-widget.ts +18 -11
  39. package/webpack.config.js +1 -12
  40. package/helm/JSDraw/Pistoia.HELM-uncompressed.js +0 -9694
  41. package/helm/JSDraw/ReadMe.txt +0 -8
  42. package/helm/JSDraw/Scilligence.JSDraw2.Lite-uncompressed.js +0 -31126
  43. package/helm/dojo/package.ts +0 -41
  44. package/helm/dojo/types.ts +0 -12
  45. package/src/helm-web-editor.ts +0 -68
  46. package/src/tests/get-monomer-tests.ts +0 -214
  47. package/src/tests/helm-service-tests.ts +0 -98
  48. package/src/types/dojo.ts +0 -3
  49. package/src/types/index.ts +0 -5
  50. package/src/utils/get-monomer.ts +0 -90
  51. package/src/utils/helm-service.ts +0 -166
  52. package/test-console-output-1.log +0 -919
  53. package/test-record-1.mp4 +0 -0
  54. package/vendor/dojo-1.10.10/dijit/BackgroundIframe.js +0 -63
  55. package/vendor/dojo-1.10.10/dijit/BackgroundIframe.js.uncompressed.js +0 -116
  56. package/vendor/dojo-1.10.10/dijit/Destroyable.js +0 -35
  57. package/vendor/dojo-1.10.10/dijit/Destroyable.js.uncompressed.js +0 -83
  58. package/vendor/dojo-1.10.10/dijit/Tooltip.js +0 -240
  59. package/vendor/dojo-1.10.10/dijit/Tooltip.js.uncompressed.js +0 -612
  60. package/vendor/dojo-1.10.10/dijit/Viewport.js +0 -44
  61. package/vendor/dojo-1.10.10/dijit/Viewport.js.uncompressed.js +0 -87
  62. package/vendor/dojo-1.10.10/dijit/WidgetSet.js +0 -76
  63. package/vendor/dojo-1.10.10/dijit/WidgetSet.js.uncompressed.js +0 -247
  64. package/vendor/dojo-1.10.10/dijit/_AttachMixin.js +0 -94
  65. package/vendor/dojo-1.10.10/dijit/_AttachMixin.js.uncompressed.js +0 -238
  66. package/vendor/dojo-1.10.10/dijit/_Contained.js +0 -17
  67. package/vendor/dojo-1.10.10/dijit/_Contained.js.uncompressed.js +0 -56
  68. package/vendor/dojo-1.10.10/dijit/_Container.js +0 -47
  69. package/vendor/dojo-1.10.10/dijit/_Container.js.uncompressed.js +0 -108
  70. package/vendor/dojo-1.10.10/dijit/_CssStateMixin.js +0 -198
  71. package/vendor/dojo-1.10.10/dijit/_CssStateMixin.js.uncompressed.js +0 -372
  72. package/vendor/dojo-1.10.10/dijit/_FocusMixin.js +0 -11
  73. package/vendor/dojo-1.10.10/dijit/_FocusMixin.js.uncompressed.js +0 -66
  74. package/vendor/dojo-1.10.10/dijit/_HasDropDown.js +0 -188
  75. package/vendor/dojo-1.10.10/dijit/_HasDropDown.js.uncompressed.js +0 -472
  76. package/vendor/dojo-1.10.10/dijit/_OnDijitClickMixin.js +0 -8
  77. package/vendor/dojo-1.10.10/dijit/_OnDijitClickMixin.js.uncompressed.js +0 -31
  78. package/vendor/dojo-1.10.10/dijit/_TemplatedMixin.js +0 -90
  79. package/vendor/dojo-1.10.10/dijit/_TemplatedMixin.js.uncompressed.js +0 -205
  80. package/vendor/dojo-1.10.10/dijit/_Widget.js +0 -66
  81. package/vendor/dojo-1.10.10/dijit/_Widget.js.uncompressed.js +0 -352
  82. package/vendor/dojo-1.10.10/dijit/_WidgetBase.js +0 -353
  83. package/vendor/dojo-1.10.10/dijit/_WidgetBase.js.uncompressed.js +0 -1200
  84. package/vendor/dojo-1.10.10/dijit/_base/focus.js +0 -68
  85. package/vendor/dojo-1.10.10/dijit/_base/focus.js.uncompressed.js +0 -207
  86. package/vendor/dojo-1.10.10/dijit/_base/manager.js +0 -10
  87. package/vendor/dojo-1.10.10/dijit/_base/manager.js.uncompressed.js +0 -35
  88. package/vendor/dojo-1.10.10/dijit/_base/place.js +0 -52
  89. package/vendor/dojo-1.10.10/dijit/_base/place.js.uncompressed.js +0 -131
  90. package/vendor/dojo-1.10.10/dijit/_base/popup.js +0 -23
  91. package/vendor/dojo-1.10.10/dijit/_base/popup.js.uncompressed.js +0 -58
  92. package/vendor/dojo-1.10.10/dijit/_base/scroll.js +0 -6
  93. package/vendor/dojo-1.10.10/dijit/_base/scroll.js.uncompressed.js +0 -22
  94. package/vendor/dojo-1.10.10/dijit/_base/sniff.js +0 -3
  95. package/vendor/dojo-1.10.10/dijit/_base/sniff.js.uncompressed.js +0 -12
  96. package/vendor/dojo-1.10.10/dijit/_base/typematic.js +0 -3
  97. package/vendor/dojo-1.10.10/dijit/_base/typematic.js.uncompressed.js +0 -10
  98. package/vendor/dojo-1.10.10/dijit/_base/wai.js +0 -32
  99. package/vendor/dojo-1.10.10/dijit/_base/wai.js.uncompressed.js +0 -109
  100. package/vendor/dojo-1.10.10/dijit/_base/window.js +0 -6
  101. package/vendor/dojo-1.10.10/dijit/_base/window.js.uncompressed.js +0 -18
  102. package/vendor/dojo-1.10.10/dijit/_base.js +0 -4
  103. package/vendor/dojo-1.10.10/dijit/_base.js.uncompressed.js +0 -27
  104. package/vendor/dojo-1.10.10/dijit/a11y.js +0 -109
  105. package/vendor/dojo-1.10.10/dijit/a11y.js.uncompressed.js +0 -191
  106. package/vendor/dojo-1.10.10/dijit/a11yclick.js +0 -66
  107. package/vendor/dojo-1.10.10/dijit/a11yclick.js.uncompressed.js +0 -139
  108. package/vendor/dojo-1.10.10/dijit/focus.js +0 -188
  109. package/vendor/dojo-1.10.10/dijit/focus.js.uncompressed.js +0 -371
  110. package/vendor/dojo-1.10.10/dijit/form/Button.js +0 -49
  111. package/vendor/dojo-1.10.10/dijit/form/Button.js.uncompressed.js +0 -130
  112. package/vendor/dojo-1.10.10/dijit/form/ComboBox.js +0 -4
  113. package/vendor/dojo-1.10.10/dijit/form/ComboBox.js.uncompressed.js +0 -27
  114. package/vendor/dojo-1.10.10/dijit/form/ComboButton.js +0 -21
  115. package/vendor/dojo-1.10.10/dijit/form/ComboButton.js.uncompressed.js +0 -86
  116. package/vendor/dojo-1.10.10/dijit/form/DropDownButton.js +0 -38
  117. package/vendor/dojo-1.10.10/dijit/form/DropDownButton.js.uncompressed.js +0 -102
  118. package/vendor/dojo-1.10.10/dijit/form/ToggleButton.js +0 -7
  119. package/vendor/dojo-1.10.10/dijit/form/ToggleButton.js.uncompressed.js +0 -26
  120. package/vendor/dojo-1.10.10/dijit/form/_ButtonMixin.js +0 -50
  121. package/vendor/dojo-1.10.10/dijit/form/_ButtonMixin.js.uncompressed.js +0 -116
  122. package/vendor/dojo-1.10.10/dijit/form/_FormValueMixin.js +0 -26
  123. package/vendor/dojo-1.10.10/dijit/form/_FormValueMixin.js.uncompressed.js +0 -81
  124. package/vendor/dojo-1.10.10/dijit/form/_FormValueWidget.js +0 -24
  125. package/vendor/dojo-1.10.10/dijit/form/_FormValueWidget.js.uncompressed.js +0 -51
  126. package/vendor/dojo-1.10.10/dijit/form/_FormWidget.js +0 -22
  127. package/vendor/dojo-1.10.10/dijit/form/_FormWidget.js.uncompressed.js +0 -67
  128. package/vendor/dojo-1.10.10/dijit/form/_FormWidgetMixin.js +0 -111
  129. package/vendor/dojo-1.10.10/dijit/form/_FormWidgetMixin.js.uncompressed.js +0 -254
  130. package/vendor/dojo-1.10.10/dijit/form/_ToggleButtonMixin.js +0 -32
  131. package/vendor/dojo-1.10.10/dijit/form/_ToggleButtonMixin.js.uncompressed.js +0 -69
  132. package/vendor/dojo-1.10.10/dijit/hccss.js +0 -9
  133. package/vendor/dojo-1.10.10/dijit/hccss.js.uncompressed.js +0 -21
  134. package/vendor/dojo-1.10.10/dijit/layout/AccordionContainer.js +0 -215
  135. package/vendor/dojo-1.10.10/dijit/layout/AccordionContainer.js.uncompressed.js +0 -550
  136. package/vendor/dojo-1.10.10/dijit/layout/AccordionPane.js +0 -7
  137. package/vendor/dojo-1.10.10/dijit/layout/AccordionPane.js.uncompressed.js +0 -25
  138. package/vendor/dojo-1.10.10/dijit/layout/ContentPane.js +0 -235
  139. package/vendor/dojo-1.10.10/dijit/layout/ContentPane.js.uncompressed.js +0 -653
  140. package/vendor/dojo-1.10.10/dijit/layout/StackContainer.js +0 -171
  141. package/vendor/dojo-1.10.10/dijit/layout/StackContainer.js.uncompressed.js +0 -411
  142. package/vendor/dojo-1.10.10/dijit/layout/StackController.js +0 -194
  143. package/vendor/dojo-1.10.10/dijit/layout/StackController.js.uncompressed.js +0 -410
  144. package/vendor/dojo-1.10.10/dijit/layout/_ContentPaneResizeMixin.js +0 -99
  145. package/vendor/dojo-1.10.10/dijit/layout/_ContentPaneResizeMixin.js.uncompressed.js +0 -236
  146. package/vendor/dojo-1.10.10/dijit/layout/_LayoutWidget.js +0 -47
  147. package/vendor/dojo-1.10.10/dijit/layout/_LayoutWidget.js.uncompressed.js +0 -190
  148. package/vendor/dojo-1.10.10/dijit/layout/utils.js +0 -77
  149. package/vendor/dojo-1.10.10/dijit/layout/utils.js.uncompressed.js +0 -151
  150. package/vendor/dojo-1.10.10/dijit/main.js +0 -4
  151. package/vendor/dojo-1.10.10/dijit/main.js.uncompressed.js +0 -16
  152. package/vendor/dojo-1.10.10/dijit/nls/dijit-all_en-us.js +0 -2
  153. package/vendor/dojo-1.10.10/dijit/nls/dijit-all_en-us.js.uncompressed.js +0 -21
  154. package/vendor/dojo-1.10.10/dijit/nls/loading.js +0 -2
  155. package/vendor/dojo-1.10.10/dijit/nls/loading.js.uncompressed.js +0 -47
  156. package/vendor/dojo-1.10.10/dijit/place.js +0 -142
  157. package/vendor/dojo-1.10.10/dijit/place.js.uncompressed.js +0 -407
  158. package/vendor/dojo-1.10.10/dijit/popup.js +0 -162
  159. package/vendor/dojo-1.10.10/dijit/popup.js.uncompressed.js +0 -441
  160. package/vendor/dojo-1.10.10/dijit/registry.js +0 -79
  161. package/vendor/dojo-1.10.10/dijit/registry.js.uncompressed.js +0 -159
  162. package/vendor/dojo-1.10.10/dijit/selection.js +0 -364
  163. package/vendor/dojo-1.10.10/dijit/selection.js.uncompressed.js +0 -525
  164. package/vendor/dojo-1.10.10/dijit/typematic.js +0 -96
  165. package/vendor/dojo-1.10.10/dijit/typematic.js.uncompressed.js +0 -211
  166. package/vendor/dojo-1.10.10/dojo/NodeList-manipulate.js +0 -195
  167. package/vendor/dojo-1.10.10/dojo/NodeList-manipulate.js.uncompressed.js +0 -761
  168. package/vendor/dojo-1.10.10/dojo/Stateful.js +0 -90
  169. package/vendor/dojo-1.10.10/dojo/Stateful.js.uncompressed.js +0 -218
  170. package/vendor/dojo-1.10.10/dojo/_base/url.js +0 -87
  171. package/vendor/dojo-1.10.10/dojo/_base/url.js.uncompressed.js +0 -109
  172. package/vendor/dojo-1.10.10/dojo/cache.js +0 -9
  173. package/vendor/dojo-1.10.10/dojo/cache.js.uncompressed.js +0 -7
  174. package/vendor/dojo-1.10.10/dojo/colors.js +0 -74
  175. package/vendor/dojo-1.10.10/dojo/colors.js.uncompressed.js +0 -232
  176. package/vendor/dojo-1.10.10/dojo/cookie.js +0 -48
  177. package/vendor/dojo-1.10.10/dojo/cookie.js.uncompressed.js +0 -98
  178. package/vendor/dojo-1.10.10/dojo/date/stamp.js +0 -82
  179. package/vendor/dojo-1.10.10/dojo/date/stamp.js.uncompressed.js +0 -144
  180. package/vendor/dojo-1.10.10/dojo/dojo.js +0 -7
  181. package/vendor/dojo-1.10.10/dojo/dojo.js.uncompressed.js +0 -18680
  182. package/vendor/dojo-1.10.10/dojo/fx/Toggler.js +0 -27
  183. package/vendor/dojo-1.10.10/dojo/fx/Toggler.js.uncompressed.js +0 -101
  184. package/vendor/dojo-1.10.10/dojo/fx/easing.js +0 -165
  185. package/vendor/dojo-1.10.10/dojo/fx/easing.js.uncompressed.js +0 -276
  186. package/vendor/dojo-1.10.10/dojo/fx.js +0 -271
  187. package/vendor/dojo-1.10.10/dojo/fx.js.uncompressed.js +0 -443
  188. package/vendor/dojo-1.10.10/dojo/hccss.js +0 -26
  189. package/vendor/dojo-1.10.10/dojo/hccss.js.uncompressed.js +0 -52
  190. package/vendor/dojo-1.10.10/dojo/html.js +0 -161
  191. package/vendor/dojo-1.10.10/dojo/html.js.uncompressed.js +0 -370
  192. package/vendor/dojo-1.10.10/dojo/io/iframe.js +0 -71
  193. package/vendor/dojo-1.10.10/dojo/io/iframe.js.uncompressed.js +0 -190
  194. package/vendor/dojo-1.10.10/dojo/io/script.js +0 -112
  195. package/vendor/dojo-1.10.10/dojo/io/script.js.uncompressed.js +0 -280
  196. package/vendor/dojo-1.10.10/dojo/parser.js +0 -437
  197. package/vendor/dojo-1.10.10/dojo/parser.js.uncompressed.js +0 -915
  198. package/vendor/dojo-1.10.10/dojo/promise/all.js +0 -59
  199. package/vendor/dojo-1.10.10/dojo/promise/all.js.uncompressed.js +0 -77
  200. package/vendor/dojo-1.10.10/dojo/regexp.js +0 -32
  201. package/vendor/dojo-1.10.10/dojo/regexp.js.uncompressed.js +0 -70
  202. package/vendor/dojo-1.10.10/dojo/request/iframe.js +0 -291
  203. package/vendor/dojo-1.10.10/dojo/request/iframe.js.uncompressed.js +0 -438
  204. package/vendor/dojo-1.10.10/dojo/request/script.js +0 -129
  205. package/vendor/dojo-1.10.10/dojo/request/script.js.uncompressed.js +0 -237
  206. package/vendor/dojo-1.10.10/dojo/require.js +0 -11
  207. package/vendor/dojo-1.10.10/dojo/require.js.uncompressed.js +0 -7
  208. package/vendor/dojo-1.10.10/dojo/resources/blank.gif +0 -0
  209. package/vendor/dojo-1.10.10/dojo/string.js +0 -67
  210. package/vendor/dojo-1.10.10/dojo/string.js.uncompressed.js +0 -181
  211. package/vendor/dojo-1.10.10/dojo/touch.js +0 -191
  212. package/vendor/dojo-1.10.10/dojo/touch.js.uncompressed.js +0 -468
  213. package/vendor/dojo-1.10.10/dojo/uacss.js +0 -36
  214. package/vendor/dojo-1.10.10/dojo/uacss.js.uncompressed.js +0 -85
  215. package/vendor/dojo-1.10.10/dojo/window.js +0 -141
  216. package/vendor/dojo-1.10.10/dojo/window.js.uncompressed.js +0 -241
  217. package/vendor/dojo-1.10.10/dojox/charting/Chart.js +0 -626
  218. package/vendor/dojo-1.10.10/dojox/charting/Chart.js.uncompressed.js +0 -1220
  219. package/vendor/dojo-1.10.10/dojox/charting/Chart2D.js +0 -5
  220. package/vendor/dojo-1.10.10/dojox/charting/Chart2D.js.uncompressed.js +0 -16
  221. package/vendor/dojo-1.10.10/dojox/charting/Element.js +0 -247
  222. package/vendor/dojo-1.10.10/dojox/charting/Element.js.uncompressed.js +0 -402
  223. package/vendor/dojo-1.10.10/dojox/charting/Series.js +0 -24
  224. package/vendor/dojo-1.10.10/dojox/charting/Series.js.uncompressed.js +0 -58
  225. package/vendor/dojo-1.10.10/dojox/charting/SimpleTheme.js +0 -191
  226. package/vendor/dojo-1.10.10/dojox/charting/SimpleTheme.js.uncompressed.js +0 -577
  227. package/vendor/dojo-1.10.10/dojox/charting/Theme.js +0 -42
  228. package/vendor/dojo-1.10.10/dojox/charting/Theme.js.uncompressed.js +0 -120
  229. package/vendor/dojo-1.10.10/dojox/charting/action2d/Base.js +0 -11
  230. package/vendor/dojo-1.10.10/dojox/charting/action2d/Base.js.uncompressed.js +0 -36
  231. package/vendor/dojo-1.10.10/dojox/charting/action2d/Highlight.js +0 -77
  232. package/vendor/dojo-1.10.10/dojox/charting/action2d/Highlight.js.uncompressed.js +0 -144
  233. package/vendor/dojo-1.10.10/dojox/charting/action2d/Magnify.js +0 -58
  234. package/vendor/dojo-1.10.10/dojox/charting/action2d/Magnify.js.uncompressed.js +0 -123
  235. package/vendor/dojo-1.10.10/dojox/charting/action2d/MoveSlice.js +0 -54
  236. package/vendor/dojo-1.10.10/dojox/charting/action2d/MoveSlice.js.uncompressed.js +0 -124
  237. package/vendor/dojo-1.10.10/dojox/charting/action2d/PlotAction.js +0 -28
  238. package/vendor/dojo-1.10.10/dojox/charting/action2d/PlotAction.js.uncompressed.js +0 -74
  239. package/vendor/dojo-1.10.10/dojox/charting/action2d/Tooltip.js +0 -116
  240. package/vendor/dojo-1.10.10/dojox/charting/action2d/Tooltip.js.uncompressed.js +0 -178
  241. package/vendor/dojo-1.10.10/dojox/charting/axis2d/Base.js +0 -24
  242. package/vendor/dojo-1.10.10/dojox/charting/axis2d/Base.js.uncompressed.js +0 -83
  243. package/vendor/dojo-1.10.10/dojox/charting/axis2d/Default.js +0 -557
  244. package/vendor/dojo-1.10.10/dojox/charting/axis2d/Default.js.uncompressed.js +0 -980
  245. package/vendor/dojo-1.10.10/dojox/charting/axis2d/Invisible.js +0 -65
  246. package/vendor/dojo-1.10.10/dojox/charting/axis2d/Invisible.js.uncompressed.js +0 -224
  247. package/vendor/dojo-1.10.10/dojox/charting/axis2d/common.js +0 -91
  248. package/vendor/dojo-1.10.10/dojox/charting/axis2d/common.js.uncompressed.js +0 -164
  249. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Areas.js +0 -7
  250. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Areas.js.uncompressed.js +0 -14
  251. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Bars.js +0 -168
  252. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Bars.js.uncompressed.js +0 -311
  253. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Base.js +0 -61
  254. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Base.js.uncompressed.js +0 -161
  255. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Bubble.js +0 -141
  256. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Bubble.js.uncompressed.js +0 -242
  257. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Candlesticks.js +0 -126
  258. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Candlesticks.js.uncompressed.js +0 -243
  259. package/vendor/dojo-1.10.10/dojox/charting/plot2d/CartesianBase.js +0 -108
  260. package/vendor/dojo-1.10.10/dojox/charting/plot2d/CartesianBase.js.uncompressed.js +0 -290
  261. package/vendor/dojo-1.10.10/dojox/charting/plot2d/ClusteredBars.js +0 -13
  262. package/vendor/dojo-1.10.10/dojox/charting/plot2d/ClusteredBars.js.uncompressed.js +0 -14
  263. package/vendor/dojo-1.10.10/dojox/charting/plot2d/ClusteredColumns.js +0 -13
  264. package/vendor/dojo-1.10.10/dojox/charting/plot2d/ClusteredColumns.js.uncompressed.js +0 -14
  265. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Columns.js +0 -153
  266. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Columns.js.uncompressed.js +0 -249
  267. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Default.js +0 -253
  268. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Default.js.uncompressed.js +0 -472
  269. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Grid.js +0 -182
  270. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Grid.js.uncompressed.js +0 -356
  271. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Lines.js +0 -6
  272. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Lines.js.uncompressed.js +0 -12
  273. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Markers.js +0 -6
  274. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Markers.js.uncompressed.js +0 -12
  275. package/vendor/dojo-1.10.10/dojox/charting/plot2d/MarkersOnly.js +0 -7
  276. package/vendor/dojo-1.10.10/dojox/charting/plot2d/MarkersOnly.js.uncompressed.js +0 -13
  277. package/vendor/dojo-1.10.10/dojox/charting/plot2d/OHLC.js +0 -110
  278. package/vendor/dojo-1.10.10/dojox/charting/plot2d/OHLC.js.uncompressed.js +0 -208
  279. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Pie.js +0 -303
  280. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Pie.js.uncompressed.js +0 -547
  281. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Scatter.js +0 -134
  282. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Scatter.js.uncompressed.js +0 -207
  283. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Spider.js +0 -299
  284. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Spider.js.uncompressed.js +0 -537
  285. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Stacked.js +0 -24
  286. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Stacked.js.uncompressed.js +0 -44
  287. package/vendor/dojo-1.10.10/dojox/charting/plot2d/StackedAreas.js +0 -7
  288. package/vendor/dojo-1.10.10/dojox/charting/plot2d/StackedAreas.js.uncompressed.js +0 -14
  289. package/vendor/dojo-1.10.10/dojox/charting/plot2d/StackedBars.js +0 -22
  290. package/vendor/dojo-1.10.10/dojox/charting/plot2d/StackedBars.js.uncompressed.js +0 -33
  291. package/vendor/dojo-1.10.10/dojox/charting/plot2d/StackedColumns.js +0 -20
  292. package/vendor/dojo-1.10.10/dojox/charting/plot2d/StackedColumns.js.uncompressed.js +0 -31
  293. package/vendor/dojo-1.10.10/dojox/charting/plot2d/StackedLines.js +0 -6
  294. package/vendor/dojo-1.10.10/dojox/charting/plot2d/StackedLines.js.uncompressed.js +0 -12
  295. package/vendor/dojo-1.10.10/dojox/charting/plot2d/_PlotEvents.js +0 -68
  296. package/vendor/dojo-1.10.10/dojox/charting/plot2d/_PlotEvents.js.uncompressed.js +0 -120
  297. package/vendor/dojo-1.10.10/dojox/charting/plot2d/common.js +0 -209
  298. package/vendor/dojo-1.10.10/dojox/charting/plot2d/common.js.uncompressed.js +0 -214
  299. package/vendor/dojo-1.10.10/dojox/charting/plot2d/commonStacked.js +0 -76
  300. package/vendor/dojo-1.10.10/dojox/charting/plot2d/commonStacked.js.uncompressed.js +0 -77
  301. package/vendor/dojo-1.10.10/dojox/charting/scaler/common.js +0 -59
  302. package/vendor/dojo-1.10.10/dojox/charting/scaler/common.js.uncompressed.js +0 -70
  303. package/vendor/dojo-1.10.10/dojox/charting/scaler/linear.js +0 -220
  304. package/vendor/dojo-1.10.10/dojox/charting/scaler/linear.js.uncompressed.js +0 -262
  305. package/vendor/dojo-1.10.10/dojox/charting/scaler/primitive.js +0 -23
  306. package/vendor/dojo-1.10.10/dojox/charting/scaler/primitive.js.uncompressed.js +0 -36
  307. package/vendor/dojo-1.10.10/dojox/charting/themes/Claro.js +0 -39
  308. package/vendor/dojo-1.10.10/dojox/charting/themes/Claro.js.uncompressed.js +0 -106
  309. package/vendor/dojo-1.10.10/dojox/charting/themes/Wetland.js +0 -5
  310. package/vendor/dojo-1.10.10/dojox/charting/themes/Wetland.js.uncompressed.js +0 -12
  311. package/vendor/dojo-1.10.10/dojox/charting/themes/common.js +0 -4
  312. package/vendor/dojo-1.10.10/dojox/charting/themes/common.js.uncompressed.js +0 -3
  313. package/vendor/dojo-1.10.10/dojox/charting/widget/Legend.js +0 -102
  314. package/vendor/dojo-1.10.10/dojox/charting/widget/Legend.js.uncompressed.js +0 -165
  315. package/vendor/dojo-1.10.10/dojox/color/Palette.js +0 -163
  316. package/vendor/dojo-1.10.10/dojox/color/Palette.js.uncompressed.js +0 -460
  317. package/vendor/dojo-1.10.10/dojox/color/_base.js +0 -174
  318. package/vendor/dojo-1.10.10/dojox/color/_base.js.uncompressed.js +0 -196
  319. package/vendor/dojo-1.10.10/dojox/gfx/_base.js +0 -253
  320. package/vendor/dojo-1.10.10/dojox/gfx/_base.js.uncompressed.js +0 -1024
  321. package/vendor/dojo-1.10.10/dojox/gfx/fx.js +0 -297
  322. package/vendor/dojo-1.10.10/dojox/gfx/fx.js.uncompressed.js +0 -350
  323. package/vendor/dojo-1.10.10/dojox/gfx/gradutils.js +0 -63
  324. package/vendor/dojo-1.10.10/dojox/gfx/gradutils.js.uncompressed.js +0 -91
  325. package/vendor/dojo-1.10.10/dojox/gfx/matrix.js +0 -170
  326. package/vendor/dojo-1.10.10/dojox/gfx/matrix.js.uncompressed.js +0 -501
  327. package/vendor/dojo-1.10.10/dojox/gfx/path.js +0 -319
  328. package/vendor/dojo-1.10.10/dojox/gfx/path.js.uncompressed.js +0 -478
  329. package/vendor/dojo-1.10.10/dojox/gfx/shape.js +0 -459
  330. package/vendor/dojo-1.10.10/dojox/gfx/shape.js.uncompressed.js +0 -1091
  331. package/vendor/dojo-1.10.10/dojox/gfx/svg.js +0 -662
  332. package/vendor/dojo-1.10.10/dojox/gfx/svg.js.uncompressed.js +0 -1023
  333. package/vendor/dojo-1.10.10/dojox/gfx/utils.js +0 -199
  334. package/vendor/dojo-1.10.10/dojox/gfx/utils.js.uncompressed.js +0 -322
  335. package/vendor/dojo-1.10.10/dojox/gfx.js +0 -2
  336. package/vendor/dojo-1.10.10/dojox/gfx.js.uncompressed.js +0 -1136
  337. package/vendor/dojo-1.10.10/dojox/lang/functional/array.js +0 -151
  338. package/vendor/dojo-1.10.10/dojox/lang/functional/array.js.uncompressed.js +0 -169
  339. package/vendor/dojo-1.10.10/dojox/lang/functional/fold.js +0 -93
  340. package/vendor/dojo-1.10.10/dojox/lang/functional/fold.js.uncompressed.js +0 -125
  341. package/vendor/dojo-1.10.10/dojox/lang/functional/lambda.js +0 -81
  342. package/vendor/dojo-1.10.10/dojox/lang/functional/lambda.js.uncompressed.js +0 -132
  343. package/vendor/dojo-1.10.10/dojox/lang/functional/object.js +0 -54
  344. package/vendor/dojo-1.10.10/dojox/lang/functional/object.js.uncompressed.js +0 -78
  345. package/vendor/dojo-1.10.10/dojox/lang/functional/reversed.js +0 -61
  346. package/vendor/dojo-1.10.10/dojox/lang/functional/reversed.js.uncompressed.js +0 -77
  347. package/vendor/dojo-1.10.10/dojox/lang/functional/scan.js +0 -87
  348. package/vendor/dojo-1.10.10/dojox/lang/functional/scan.js.uncompressed.js +0 -107
  349. package/vendor/dojo-1.10.10/dojox/lang/functional.js +0 -4
  350. package/vendor/dojo-1.10.10/dojox/lang/functional.js.uncompressed.js +0 -3
  351. package/vendor/dojo-1.10.10/dojox/lang/utils.js +0 -86
  352. package/vendor/dojo-1.10.10/dojox/lang/utils.js.uncompressed.js +0 -121
  353. package/vendor/dojo-1.10.10/dojox/main.js +0 -4
  354. package/vendor/dojo-1.10.10/dojox/main.js.uncompressed.js +0 -14
  355. package/vendor/dojo-1.10.10/dojox/storage/LocalStorageProvider.js +0 -112
  356. package/vendor/dojo-1.10.10/dojox/storage/LocalStorageProvider.js.uncompressed.js +0 -208
  357. package/vendor/dojo-1.10.10/dojox/storage/Provider.js +0 -62
  358. package/vendor/dojo-1.10.10/dojox/storage/Provider.js.uncompressed.js +0 -344
  359. package/vendor/dojo-1.10.10/dojox/storage/manager.js +0 -110
  360. package/vendor/dojo-1.10.10/dojox/storage/manager.js.uncompressed.js +0 -263
@@ -0,0 +1,1560 @@
1
+ "use strict";
2
+ (self["webpackChunkhelm"] = self["webpackChunkhelm"] || []).push([["vendors-HELM_node_modules_lru-cache_dist_esm_index_js"],{
3
+
4
+ /***/ "../../../HELM/node_modules/lru-cache/dist/esm/index.js":
5
+ /*!**************************************************************!*\
6
+ !*** ../../../HELM/node_modules/lru-cache/dist/esm/index.js ***!
7
+ \**************************************************************/
8
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
9
+
10
+ __webpack_require__.r(__webpack_exports__);
11
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12
+ /* harmony export */ LRUCache: () => (/* binding */ LRUCache)
13
+ /* harmony export */ });
14
+ /**
15
+ * @module LRUCache
16
+ */
17
+ const perf = typeof performance === 'object' &&
18
+ performance &&
19
+ typeof performance.now === 'function'
20
+ ? performance
21
+ : Date;
22
+ const warned = new Set();
23
+ /* c8 ignore start */
24
+ const PROCESS = (typeof process === 'object' && !!process ? process : {});
25
+ /* c8 ignore start */
26
+ const emitWarning = (msg, type, code, fn) => {
27
+ typeof PROCESS.emitWarning === 'function'
28
+ ? PROCESS.emitWarning(msg, type, code, fn)
29
+ : console.error(`[${code}] ${type}: ${msg}`);
30
+ };
31
+ let AC = globalThis.AbortController;
32
+ let AS = globalThis.AbortSignal;
33
+ /* c8 ignore start */
34
+ if (typeof AC === 'undefined') {
35
+ //@ts-ignore
36
+ AS = class AbortSignal {
37
+ onabort;
38
+ _onabort = [];
39
+ reason;
40
+ aborted = false;
41
+ addEventListener(_, fn) {
42
+ this._onabort.push(fn);
43
+ }
44
+ };
45
+ //@ts-ignore
46
+ AC = class AbortController {
47
+ constructor() {
48
+ warnACPolyfill();
49
+ }
50
+ signal = new AS();
51
+ abort(reason) {
52
+ if (this.signal.aborted)
53
+ return;
54
+ //@ts-ignore
55
+ this.signal.reason = reason;
56
+ //@ts-ignore
57
+ this.signal.aborted = true;
58
+ //@ts-ignore
59
+ for (const fn of this.signal._onabort) {
60
+ fn(reason);
61
+ }
62
+ this.signal.onabort?.(reason);
63
+ }
64
+ };
65
+ let printACPolyfillWarning = PROCESS.env?.LRU_CACHE_IGNORE_AC_WARNING !== '1';
66
+ const warnACPolyfill = () => {
67
+ if (!printACPolyfillWarning)
68
+ return;
69
+ printACPolyfillWarning = false;
70
+ emitWarning('AbortController is not defined. If using lru-cache in ' +
71
+ 'node 14, load an AbortController polyfill from the ' +
72
+ '`node-abort-controller` package. A minimal polyfill is ' +
73
+ 'provided for use by LRUCache.fetch(), but it should not be ' +
74
+ 'relied upon in other contexts (eg, passing it to other APIs that ' +
75
+ 'use AbortController/AbortSignal might have undesirable effects). ' +
76
+ 'You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.', 'NO_ABORT_CONTROLLER', 'ENOTSUP', warnACPolyfill);
77
+ };
78
+ }
79
+ /* c8 ignore stop */
80
+ const shouldWarn = (code) => !warned.has(code);
81
+ const TYPE = Symbol('type');
82
+ const isPosInt = (n) => n && n === Math.floor(n) && n > 0 && isFinite(n);
83
+ /* c8 ignore start */
84
+ // This is a little bit ridiculous, tbh.
85
+ // The maximum array length is 2^32-1 or thereabouts on most JS impls.
86
+ // And well before that point, you're caching the entire world, I mean,
87
+ // that's ~32GB of just integers for the next/prev links, plus whatever
88
+ // else to hold that many keys and values. Just filling the memory with
89
+ // zeroes at init time is brutal when you get that big.
90
+ // But why not be complete?
91
+ // Maybe in the future, these limits will have expanded.
92
+ const getUintArray = (max) => !isPosInt(max)
93
+ ? null
94
+ : max <= Math.pow(2, 8)
95
+ ? Uint8Array
96
+ : max <= Math.pow(2, 16)
97
+ ? Uint16Array
98
+ : max <= Math.pow(2, 32)
99
+ ? Uint32Array
100
+ : max <= Number.MAX_SAFE_INTEGER
101
+ ? ZeroArray
102
+ : null;
103
+ /* c8 ignore stop */
104
+ class ZeroArray extends Array {
105
+ constructor(size) {
106
+ super(size);
107
+ this.fill(0);
108
+ }
109
+ }
110
+ class Stack {
111
+ heap;
112
+ length;
113
+ // private constructor
114
+ static #constructing = false;
115
+ static create(max) {
116
+ const HeapCls = getUintArray(max);
117
+ if (!HeapCls)
118
+ return [];
119
+ Stack.#constructing = true;
120
+ const s = new Stack(max, HeapCls);
121
+ Stack.#constructing = false;
122
+ return s;
123
+ }
124
+ constructor(max, HeapCls) {
125
+ /* c8 ignore start */
126
+ if (!Stack.#constructing) {
127
+ throw new TypeError('instantiate Stack using Stack.create(n)');
128
+ }
129
+ /* c8 ignore stop */
130
+ this.heap = new HeapCls(max);
131
+ this.length = 0;
132
+ }
133
+ push(n) {
134
+ this.heap[this.length++] = n;
135
+ }
136
+ pop() {
137
+ return this.heap[--this.length];
138
+ }
139
+ }
140
+ /**
141
+ * Default export, the thing you're using this module to get.
142
+ *
143
+ * The `K` and `V` types define the key and value types, respectively. The
144
+ * optional `FC` type defines the type of the `context` object passed to
145
+ * `cache.fetch()` and `cache.memo()`.
146
+ *
147
+ * Keys and values **must not** be `null` or `undefined`.
148
+ *
149
+ * All properties from the options object (with the exception of `max`,
150
+ * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are
151
+ * added as normal public members. (The listed options are read-only getters.)
152
+ *
153
+ * Changing any of these will alter the defaults for subsequent method calls.
154
+ */
155
+ class LRUCache {
156
+ // options that cannot be changed without disaster
157
+ #max;
158
+ #maxSize;
159
+ #dispose;
160
+ #disposeAfter;
161
+ #fetchMethod;
162
+ #memoMethod;
163
+ /**
164
+ * {@link LRUCache.OptionsBase.ttl}
165
+ */
166
+ ttl;
167
+ /**
168
+ * {@link LRUCache.OptionsBase.ttlResolution}
169
+ */
170
+ ttlResolution;
171
+ /**
172
+ * {@link LRUCache.OptionsBase.ttlAutopurge}
173
+ */
174
+ ttlAutopurge;
175
+ /**
176
+ * {@link LRUCache.OptionsBase.updateAgeOnGet}
177
+ */
178
+ updateAgeOnGet;
179
+ /**
180
+ * {@link LRUCache.OptionsBase.updateAgeOnHas}
181
+ */
182
+ updateAgeOnHas;
183
+ /**
184
+ * {@link LRUCache.OptionsBase.allowStale}
185
+ */
186
+ allowStale;
187
+ /**
188
+ * {@link LRUCache.OptionsBase.noDisposeOnSet}
189
+ */
190
+ noDisposeOnSet;
191
+ /**
192
+ * {@link LRUCache.OptionsBase.noUpdateTTL}
193
+ */
194
+ noUpdateTTL;
195
+ /**
196
+ * {@link LRUCache.OptionsBase.maxEntrySize}
197
+ */
198
+ maxEntrySize;
199
+ /**
200
+ * {@link LRUCache.OptionsBase.sizeCalculation}
201
+ */
202
+ sizeCalculation;
203
+ /**
204
+ * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}
205
+ */
206
+ noDeleteOnFetchRejection;
207
+ /**
208
+ * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}
209
+ */
210
+ noDeleteOnStaleGet;
211
+ /**
212
+ * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}
213
+ */
214
+ allowStaleOnFetchAbort;
215
+ /**
216
+ * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}
217
+ */
218
+ allowStaleOnFetchRejection;
219
+ /**
220
+ * {@link LRUCache.OptionsBase.ignoreFetchAbort}
221
+ */
222
+ ignoreFetchAbort;
223
+ // computed properties
224
+ #size;
225
+ #calculatedSize;
226
+ #keyMap;
227
+ #keyList;
228
+ #valList;
229
+ #next;
230
+ #prev;
231
+ #head;
232
+ #tail;
233
+ #free;
234
+ #disposed;
235
+ #sizes;
236
+ #starts;
237
+ #ttls;
238
+ #hasDispose;
239
+ #hasFetchMethod;
240
+ #hasDisposeAfter;
241
+ /**
242
+ * Do not call this method unless you need to inspect the
243
+ * inner workings of the cache. If anything returned by this
244
+ * object is modified in any way, strange breakage may occur.
245
+ *
246
+ * These fields are private for a reason!
247
+ *
248
+ * @internal
249
+ */
250
+ static unsafeExposeInternals(c) {
251
+ return {
252
+ // properties
253
+ starts: c.#starts,
254
+ ttls: c.#ttls,
255
+ sizes: c.#sizes,
256
+ keyMap: c.#keyMap,
257
+ keyList: c.#keyList,
258
+ valList: c.#valList,
259
+ next: c.#next,
260
+ prev: c.#prev,
261
+ get head() {
262
+ return c.#head;
263
+ },
264
+ get tail() {
265
+ return c.#tail;
266
+ },
267
+ free: c.#free,
268
+ // methods
269
+ isBackgroundFetch: (p) => c.#isBackgroundFetch(p),
270
+ backgroundFetch: (k, index, options, context) => c.#backgroundFetch(k, index, options, context),
271
+ moveToTail: (index) => c.#moveToTail(index),
272
+ indexes: (options) => c.#indexes(options),
273
+ rindexes: (options) => c.#rindexes(options),
274
+ isStale: (index) => c.#isStale(index),
275
+ };
276
+ }
277
+ // Protected read-only members
278
+ /**
279
+ * {@link LRUCache.OptionsBase.max} (read-only)
280
+ */
281
+ get max() {
282
+ return this.#max;
283
+ }
284
+ /**
285
+ * {@link LRUCache.OptionsBase.maxSize} (read-only)
286
+ */
287
+ get maxSize() {
288
+ return this.#maxSize;
289
+ }
290
+ /**
291
+ * The total computed size of items in the cache (read-only)
292
+ */
293
+ get calculatedSize() {
294
+ return this.#calculatedSize;
295
+ }
296
+ /**
297
+ * The number of items stored in the cache (read-only)
298
+ */
299
+ get size() {
300
+ return this.#size;
301
+ }
302
+ /**
303
+ * {@link LRUCache.OptionsBase.fetchMethod} (read-only)
304
+ */
305
+ get fetchMethod() {
306
+ return this.#fetchMethod;
307
+ }
308
+ get memoMethod() {
309
+ return this.#memoMethod;
310
+ }
311
+ /**
312
+ * {@link LRUCache.OptionsBase.dispose} (read-only)
313
+ */
314
+ get dispose() {
315
+ return this.#dispose;
316
+ }
317
+ /**
318
+ * {@link LRUCache.OptionsBase.disposeAfter} (read-only)
319
+ */
320
+ get disposeAfter() {
321
+ return this.#disposeAfter;
322
+ }
323
+ constructor(options) {
324
+ const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort, } = options;
325
+ if (max !== 0 && !isPosInt(max)) {
326
+ throw new TypeError('max option must be a nonnegative integer');
327
+ }
328
+ const UintArray = max ? getUintArray(max) : Array;
329
+ if (!UintArray) {
330
+ throw new Error('invalid max value: ' + max);
331
+ }
332
+ this.#max = max;
333
+ this.#maxSize = maxSize;
334
+ this.maxEntrySize = maxEntrySize || this.#maxSize;
335
+ this.sizeCalculation = sizeCalculation;
336
+ if (this.sizeCalculation) {
337
+ if (!this.#maxSize && !this.maxEntrySize) {
338
+ throw new TypeError('cannot set sizeCalculation without setting maxSize or maxEntrySize');
339
+ }
340
+ if (typeof this.sizeCalculation !== 'function') {
341
+ throw new TypeError('sizeCalculation set to non-function');
342
+ }
343
+ }
344
+ if (memoMethod !== undefined &&
345
+ typeof memoMethod !== 'function') {
346
+ throw new TypeError('memoMethod must be a function if defined');
347
+ }
348
+ this.#memoMethod = memoMethod;
349
+ if (fetchMethod !== undefined &&
350
+ typeof fetchMethod !== 'function') {
351
+ throw new TypeError('fetchMethod must be a function if specified');
352
+ }
353
+ this.#fetchMethod = fetchMethod;
354
+ this.#hasFetchMethod = !!fetchMethod;
355
+ this.#keyMap = new Map();
356
+ this.#keyList = new Array(max).fill(undefined);
357
+ this.#valList = new Array(max).fill(undefined);
358
+ this.#next = new UintArray(max);
359
+ this.#prev = new UintArray(max);
360
+ this.#head = 0;
361
+ this.#tail = 0;
362
+ this.#free = Stack.create(max);
363
+ this.#size = 0;
364
+ this.#calculatedSize = 0;
365
+ if (typeof dispose === 'function') {
366
+ this.#dispose = dispose;
367
+ }
368
+ if (typeof disposeAfter === 'function') {
369
+ this.#disposeAfter = disposeAfter;
370
+ this.#disposed = [];
371
+ }
372
+ else {
373
+ this.#disposeAfter = undefined;
374
+ this.#disposed = undefined;
375
+ }
376
+ this.#hasDispose = !!this.#dispose;
377
+ this.#hasDisposeAfter = !!this.#disposeAfter;
378
+ this.noDisposeOnSet = !!noDisposeOnSet;
379
+ this.noUpdateTTL = !!noUpdateTTL;
380
+ this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection;
381
+ this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection;
382
+ this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort;
383
+ this.ignoreFetchAbort = !!ignoreFetchAbort;
384
+ // NB: maxEntrySize is set to maxSize if it's set
385
+ if (this.maxEntrySize !== 0) {
386
+ if (this.#maxSize !== 0) {
387
+ if (!isPosInt(this.#maxSize)) {
388
+ throw new TypeError('maxSize must be a positive integer if specified');
389
+ }
390
+ }
391
+ if (!isPosInt(this.maxEntrySize)) {
392
+ throw new TypeError('maxEntrySize must be a positive integer if specified');
393
+ }
394
+ this.#initializeSizeTracking();
395
+ }
396
+ this.allowStale = !!allowStale;
397
+ this.noDeleteOnStaleGet = !!noDeleteOnStaleGet;
398
+ this.updateAgeOnGet = !!updateAgeOnGet;
399
+ this.updateAgeOnHas = !!updateAgeOnHas;
400
+ this.ttlResolution =
401
+ isPosInt(ttlResolution) || ttlResolution === 0
402
+ ? ttlResolution
403
+ : 1;
404
+ this.ttlAutopurge = !!ttlAutopurge;
405
+ this.ttl = ttl || 0;
406
+ if (this.ttl) {
407
+ if (!isPosInt(this.ttl)) {
408
+ throw new TypeError('ttl must be a positive integer if specified');
409
+ }
410
+ this.#initializeTTLTracking();
411
+ }
412
+ // do not allow completely unbounded caches
413
+ if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {
414
+ throw new TypeError('At least one of max, maxSize, or ttl is required');
415
+ }
416
+ if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {
417
+ const code = 'LRU_CACHE_UNBOUNDED';
418
+ if (shouldWarn(code)) {
419
+ warned.add(code);
420
+ const msg = 'TTL caching without ttlAutopurge, max, or maxSize can ' +
421
+ 'result in unbounded memory consumption.';
422
+ emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache);
423
+ }
424
+ }
425
+ }
426
+ /**
427
+ * Return the number of ms left in the item's TTL. If item is not in cache,
428
+ * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.
429
+ */
430
+ getRemainingTTL(key) {
431
+ return this.#keyMap.has(key) ? Infinity : 0;
432
+ }
433
+ #initializeTTLTracking() {
434
+ const ttls = new ZeroArray(this.#max);
435
+ const starts = new ZeroArray(this.#max);
436
+ this.#ttls = ttls;
437
+ this.#starts = starts;
438
+ this.#setItemTTL = (index, ttl, start = perf.now()) => {
439
+ starts[index] = ttl !== 0 ? start : 0;
440
+ ttls[index] = ttl;
441
+ if (ttl !== 0 && this.ttlAutopurge) {
442
+ const t = setTimeout(() => {
443
+ if (this.#isStale(index)) {
444
+ this.#delete(this.#keyList[index], 'expire');
445
+ }
446
+ }, ttl + 1);
447
+ // unref() not supported on all platforms
448
+ /* c8 ignore start */
449
+ if (t.unref) {
450
+ t.unref();
451
+ }
452
+ /* c8 ignore stop */
453
+ }
454
+ };
455
+ this.#updateItemAge = index => {
456
+ starts[index] = ttls[index] !== 0 ? perf.now() : 0;
457
+ };
458
+ this.#statusTTL = (status, index) => {
459
+ if (ttls[index]) {
460
+ const ttl = ttls[index];
461
+ const start = starts[index];
462
+ /* c8 ignore next */
463
+ if (!ttl || !start)
464
+ return;
465
+ status.ttl = ttl;
466
+ status.start = start;
467
+ status.now = cachedNow || getNow();
468
+ const age = status.now - start;
469
+ status.remainingTTL = ttl - age;
470
+ }
471
+ };
472
+ // debounce calls to perf.now() to 1s so we're not hitting
473
+ // that costly call repeatedly.
474
+ let cachedNow = 0;
475
+ const getNow = () => {
476
+ const n = perf.now();
477
+ if (this.ttlResolution > 0) {
478
+ cachedNow = n;
479
+ const t = setTimeout(() => (cachedNow = 0), this.ttlResolution);
480
+ // not available on all platforms
481
+ /* c8 ignore start */
482
+ if (t.unref) {
483
+ t.unref();
484
+ }
485
+ /* c8 ignore stop */
486
+ }
487
+ return n;
488
+ };
489
+ this.getRemainingTTL = key => {
490
+ const index = this.#keyMap.get(key);
491
+ if (index === undefined) {
492
+ return 0;
493
+ }
494
+ const ttl = ttls[index];
495
+ const start = starts[index];
496
+ if (!ttl || !start) {
497
+ return Infinity;
498
+ }
499
+ const age = (cachedNow || getNow()) - start;
500
+ return ttl - age;
501
+ };
502
+ this.#isStale = index => {
503
+ const s = starts[index];
504
+ const t = ttls[index];
505
+ return !!t && !!s && (cachedNow || getNow()) - s > t;
506
+ };
507
+ }
508
+ // conditionally set private methods related to TTL
509
+ #updateItemAge = () => { };
510
+ #statusTTL = () => { };
511
+ #setItemTTL = () => { };
512
+ /* c8 ignore stop */
513
+ #isStale = () => false;
514
+ #initializeSizeTracking() {
515
+ const sizes = new ZeroArray(this.#max);
516
+ this.#calculatedSize = 0;
517
+ this.#sizes = sizes;
518
+ this.#removeItemSize = index => {
519
+ this.#calculatedSize -= sizes[index];
520
+ sizes[index] = 0;
521
+ };
522
+ this.#requireSize = (k, v, size, sizeCalculation) => {
523
+ // provisionally accept background fetches.
524
+ // actual value size will be checked when they return.
525
+ if (this.#isBackgroundFetch(v)) {
526
+ return 0;
527
+ }
528
+ if (!isPosInt(size)) {
529
+ if (sizeCalculation) {
530
+ if (typeof sizeCalculation !== 'function') {
531
+ throw new TypeError('sizeCalculation must be a function');
532
+ }
533
+ size = sizeCalculation(v, k);
534
+ if (!isPosInt(size)) {
535
+ throw new TypeError('sizeCalculation return invalid (expect positive integer)');
536
+ }
537
+ }
538
+ else {
539
+ throw new TypeError('invalid size value (must be positive integer). ' +
540
+ 'When maxSize or maxEntrySize is used, sizeCalculation ' +
541
+ 'or size must be set.');
542
+ }
543
+ }
544
+ return size;
545
+ };
546
+ this.#addItemSize = (index, size, status) => {
547
+ sizes[index] = size;
548
+ if (this.#maxSize) {
549
+ const maxSize = this.#maxSize - sizes[index];
550
+ while (this.#calculatedSize > maxSize) {
551
+ this.#evict(true);
552
+ }
553
+ }
554
+ this.#calculatedSize += sizes[index];
555
+ if (status) {
556
+ status.entrySize = size;
557
+ status.totalCalculatedSize = this.#calculatedSize;
558
+ }
559
+ };
560
+ }
561
+ #removeItemSize = _i => { };
562
+ #addItemSize = (_i, _s, _st) => { };
563
+ #requireSize = (_k, _v, size, sizeCalculation) => {
564
+ if (size || sizeCalculation) {
565
+ throw new TypeError('cannot set size without setting maxSize or maxEntrySize on cache');
566
+ }
567
+ return 0;
568
+ };
569
+ *#indexes({ allowStale = this.allowStale } = {}) {
570
+ if (this.#size) {
571
+ for (let i = this.#tail; true;) {
572
+ if (!this.#isValidIndex(i)) {
573
+ break;
574
+ }
575
+ if (allowStale || !this.#isStale(i)) {
576
+ yield i;
577
+ }
578
+ if (i === this.#head) {
579
+ break;
580
+ }
581
+ else {
582
+ i = this.#prev[i];
583
+ }
584
+ }
585
+ }
586
+ }
587
+ *#rindexes({ allowStale = this.allowStale } = {}) {
588
+ if (this.#size) {
589
+ for (let i = this.#head; true;) {
590
+ if (!this.#isValidIndex(i)) {
591
+ break;
592
+ }
593
+ if (allowStale || !this.#isStale(i)) {
594
+ yield i;
595
+ }
596
+ if (i === this.#tail) {
597
+ break;
598
+ }
599
+ else {
600
+ i = this.#next[i];
601
+ }
602
+ }
603
+ }
604
+ }
605
+ #isValidIndex(index) {
606
+ return (index !== undefined &&
607
+ this.#keyMap.get(this.#keyList[index]) === index);
608
+ }
609
+ /**
610
+ * Return a generator yielding `[key, value]` pairs,
611
+ * in order from most recently used to least recently used.
612
+ */
613
+ *entries() {
614
+ for (const i of this.#indexes()) {
615
+ if (this.#valList[i] !== undefined &&
616
+ this.#keyList[i] !== undefined &&
617
+ !this.#isBackgroundFetch(this.#valList[i])) {
618
+ yield [this.#keyList[i], this.#valList[i]];
619
+ }
620
+ }
621
+ }
622
+ /**
623
+ * Inverse order version of {@link LRUCache.entries}
624
+ *
625
+ * Return a generator yielding `[key, value]` pairs,
626
+ * in order from least recently used to most recently used.
627
+ */
628
+ *rentries() {
629
+ for (const i of this.#rindexes()) {
630
+ if (this.#valList[i] !== undefined &&
631
+ this.#keyList[i] !== undefined &&
632
+ !this.#isBackgroundFetch(this.#valList[i])) {
633
+ yield [this.#keyList[i], this.#valList[i]];
634
+ }
635
+ }
636
+ }
637
+ /**
638
+ * Return a generator yielding the keys in the cache,
639
+ * in order from most recently used to least recently used.
640
+ */
641
+ *keys() {
642
+ for (const i of this.#indexes()) {
643
+ const k = this.#keyList[i];
644
+ if (k !== undefined &&
645
+ !this.#isBackgroundFetch(this.#valList[i])) {
646
+ yield k;
647
+ }
648
+ }
649
+ }
650
+ /**
651
+ * Inverse order version of {@link LRUCache.keys}
652
+ *
653
+ * Return a generator yielding the keys in the cache,
654
+ * in order from least recently used to most recently used.
655
+ */
656
+ *rkeys() {
657
+ for (const i of this.#rindexes()) {
658
+ const k = this.#keyList[i];
659
+ if (k !== undefined &&
660
+ !this.#isBackgroundFetch(this.#valList[i])) {
661
+ yield k;
662
+ }
663
+ }
664
+ }
665
+ /**
666
+ * Return a generator yielding the values in the cache,
667
+ * in order from most recently used to least recently used.
668
+ */
669
+ *values() {
670
+ for (const i of this.#indexes()) {
671
+ const v = this.#valList[i];
672
+ if (v !== undefined &&
673
+ !this.#isBackgroundFetch(this.#valList[i])) {
674
+ yield this.#valList[i];
675
+ }
676
+ }
677
+ }
678
+ /**
679
+ * Inverse order version of {@link LRUCache.values}
680
+ *
681
+ * Return a generator yielding the values in the cache,
682
+ * in order from least recently used to most recently used.
683
+ */
684
+ *rvalues() {
685
+ for (const i of this.#rindexes()) {
686
+ const v = this.#valList[i];
687
+ if (v !== undefined &&
688
+ !this.#isBackgroundFetch(this.#valList[i])) {
689
+ yield this.#valList[i];
690
+ }
691
+ }
692
+ }
693
+ /**
694
+ * Iterating over the cache itself yields the same results as
695
+ * {@link LRUCache.entries}
696
+ */
697
+ [Symbol.iterator]() {
698
+ return this.entries();
699
+ }
700
+ /**
701
+ * A String value that is used in the creation of the default string
702
+ * description of an object. Called by the built-in method
703
+ * `Object.prototype.toString`.
704
+ */
705
+ [Symbol.toStringTag] = 'LRUCache';
706
+ /**
707
+ * Find a value for which the supplied fn method returns a truthy value,
708
+ * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.
709
+ */
710
+ find(fn, getOptions = {}) {
711
+ for (const i of this.#indexes()) {
712
+ const v = this.#valList[i];
713
+ const value = this.#isBackgroundFetch(v)
714
+ ? v.__staleWhileFetching
715
+ : v;
716
+ if (value === undefined)
717
+ continue;
718
+ if (fn(value, this.#keyList[i], this)) {
719
+ return this.get(this.#keyList[i], getOptions);
720
+ }
721
+ }
722
+ }
723
+ /**
724
+ * Call the supplied function on each item in the cache, in order from most
725
+ * recently used to least recently used.
726
+ *
727
+ * `fn` is called as `fn(value, key, cache)`.
728
+ *
729
+ * If `thisp` is provided, function will be called in the `this`-context of
730
+ * the provided object, or the cache if no `thisp` object is provided.
731
+ *
732
+ * Does not update age or recenty of use, or iterate over stale values.
733
+ */
734
+ forEach(fn, thisp = this) {
735
+ for (const i of this.#indexes()) {
736
+ const v = this.#valList[i];
737
+ const value = this.#isBackgroundFetch(v)
738
+ ? v.__staleWhileFetching
739
+ : v;
740
+ if (value === undefined)
741
+ continue;
742
+ fn.call(thisp, value, this.#keyList[i], this);
743
+ }
744
+ }
745
+ /**
746
+ * The same as {@link LRUCache.forEach} but items are iterated over in
747
+ * reverse order. (ie, less recently used items are iterated over first.)
748
+ */
749
+ rforEach(fn, thisp = this) {
750
+ for (const i of this.#rindexes()) {
751
+ const v = this.#valList[i];
752
+ const value = this.#isBackgroundFetch(v)
753
+ ? v.__staleWhileFetching
754
+ : v;
755
+ if (value === undefined)
756
+ continue;
757
+ fn.call(thisp, value, this.#keyList[i], this);
758
+ }
759
+ }
760
+ /**
761
+ * Delete any stale entries. Returns true if anything was removed,
762
+ * false otherwise.
763
+ */
764
+ purgeStale() {
765
+ let deleted = false;
766
+ for (const i of this.#rindexes({ allowStale: true })) {
767
+ if (this.#isStale(i)) {
768
+ this.#delete(this.#keyList[i], 'expire');
769
+ deleted = true;
770
+ }
771
+ }
772
+ return deleted;
773
+ }
774
+ /**
775
+ * Get the extended info about a given entry, to get its value, size, and
776
+ * TTL info simultaneously. Returns `undefined` if the key is not present.
777
+ *
778
+ * Unlike {@link LRUCache#dump}, which is designed to be portable and survive
779
+ * serialization, the `start` value is always the current timestamp, and the
780
+ * `ttl` is a calculated remaining time to live (negative if expired).
781
+ *
782
+ * Always returns stale values, if their info is found in the cache, so be
783
+ * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})
784
+ * if relevant.
785
+ */
786
+ info(key) {
787
+ const i = this.#keyMap.get(key);
788
+ if (i === undefined)
789
+ return undefined;
790
+ const v = this.#valList[i];
791
+ const value = this.#isBackgroundFetch(v)
792
+ ? v.__staleWhileFetching
793
+ : v;
794
+ if (value === undefined)
795
+ return undefined;
796
+ const entry = { value };
797
+ if (this.#ttls && this.#starts) {
798
+ const ttl = this.#ttls[i];
799
+ const start = this.#starts[i];
800
+ if (ttl && start) {
801
+ const remain = ttl - (perf.now() - start);
802
+ entry.ttl = remain;
803
+ entry.start = Date.now();
804
+ }
805
+ }
806
+ if (this.#sizes) {
807
+ entry.size = this.#sizes[i];
808
+ }
809
+ return entry;
810
+ }
811
+ /**
812
+ * Return an array of [key, {@link LRUCache.Entry}] tuples which can be
813
+ * passed to {@link LRLUCache#load}.
814
+ *
815
+ * The `start` fields are calculated relative to a portable `Date.now()`
816
+ * timestamp, even if `performance.now()` is available.
817
+ *
818
+ * Stale entries are always included in the `dump`, even if
819
+ * {@link LRUCache.OptionsBase.allowStale} is false.
820
+ *
821
+ * Note: this returns an actual array, not a generator, so it can be more
822
+ * easily passed around.
823
+ */
824
+ dump() {
825
+ const arr = [];
826
+ for (const i of this.#indexes({ allowStale: true })) {
827
+ const key = this.#keyList[i];
828
+ const v = this.#valList[i];
829
+ const value = this.#isBackgroundFetch(v)
830
+ ? v.__staleWhileFetching
831
+ : v;
832
+ if (value === undefined || key === undefined)
833
+ continue;
834
+ const entry = { value };
835
+ if (this.#ttls && this.#starts) {
836
+ entry.ttl = this.#ttls[i];
837
+ // always dump the start relative to a portable timestamp
838
+ // it's ok for this to be a bit slow, it's a rare operation.
839
+ const age = perf.now() - this.#starts[i];
840
+ entry.start = Math.floor(Date.now() - age);
841
+ }
842
+ if (this.#sizes) {
843
+ entry.size = this.#sizes[i];
844
+ }
845
+ arr.unshift([key, entry]);
846
+ }
847
+ return arr;
848
+ }
849
+ /**
850
+ * Reset the cache and load in the items in entries in the order listed.
851
+ *
852
+ * The shape of the resulting cache may be different if the same options are
853
+ * not used in both caches.
854
+ *
855
+ * The `start` fields are assumed to be calculated relative to a portable
856
+ * `Date.now()` timestamp, even if `performance.now()` is available.
857
+ */
858
+ load(arr) {
859
+ this.clear();
860
+ for (const [key, entry] of arr) {
861
+ if (entry.start) {
862
+ // entry.start is a portable timestamp, but we may be using
863
+ // node's performance.now(), so calculate the offset, so that
864
+ // we get the intended remaining TTL, no matter how long it's
865
+ // been on ice.
866
+ //
867
+ // it's ok for this to be a bit slow, it's a rare operation.
868
+ const age = Date.now() - entry.start;
869
+ entry.start = perf.now() - age;
870
+ }
871
+ this.set(key, entry.value, entry);
872
+ }
873
+ }
874
+ /**
875
+ * Add a value to the cache.
876
+ *
877
+ * Note: if `undefined` is specified as a value, this is an alias for
878
+ * {@link LRUCache#delete}
879
+ *
880
+ * Fields on the {@link LRUCache.SetOptions} options param will override
881
+ * their corresponding values in the constructor options for the scope
882
+ * of this single `set()` operation.
883
+ *
884
+ * If `start` is provided, then that will set the effective start
885
+ * time for the TTL calculation. Note that this must be a previous
886
+ * value of `performance.now()` if supported, or a previous value of
887
+ * `Date.now()` if not.
888
+ *
889
+ * Options object may also include `size`, which will prevent
890
+ * calling the `sizeCalculation` function and just use the specified
891
+ * number if it is a positive integer, and `noDisposeOnSet` which
892
+ * will prevent calling a `dispose` function in the case of
893
+ * overwrites.
894
+ *
895
+ * If the `size` (or return value of `sizeCalculation`) for a given
896
+ * entry is greater than `maxEntrySize`, then the item will not be
897
+ * added to the cache.
898
+ *
899
+ * Will update the recency of the entry.
900
+ *
901
+ * If the value is `undefined`, then this is an alias for
902
+ * `cache.delete(key)`. `undefined` is never stored in the cache.
903
+ */
904
+ set(k, v, setOptions = {}) {
905
+ if (v === undefined) {
906
+ this.delete(k);
907
+ return this;
908
+ }
909
+ const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status, } = setOptions;
910
+ let { noUpdateTTL = this.noUpdateTTL } = setOptions;
911
+ const size = this.#requireSize(k, v, setOptions.size || 0, sizeCalculation);
912
+ // if the item doesn't fit, don't do anything
913
+ // NB: maxEntrySize set to maxSize by default
914
+ if (this.maxEntrySize && size > this.maxEntrySize) {
915
+ if (status) {
916
+ status.set = 'miss';
917
+ status.maxEntrySizeExceeded = true;
918
+ }
919
+ // have to delete, in case something is there already.
920
+ this.#delete(k, 'set');
921
+ return this;
922
+ }
923
+ let index = this.#size === 0 ? undefined : this.#keyMap.get(k);
924
+ if (index === undefined) {
925
+ // addition
926
+ index = (this.#size === 0
927
+ ? this.#tail
928
+ : this.#free.length !== 0
929
+ ? this.#free.pop()
930
+ : this.#size === this.#max
931
+ ? this.#evict(false)
932
+ : this.#size);
933
+ this.#keyList[index] = k;
934
+ this.#valList[index] = v;
935
+ this.#keyMap.set(k, index);
936
+ this.#next[this.#tail] = index;
937
+ this.#prev[index] = this.#tail;
938
+ this.#tail = index;
939
+ this.#size++;
940
+ this.#addItemSize(index, size, status);
941
+ if (status)
942
+ status.set = 'add';
943
+ noUpdateTTL = false;
944
+ }
945
+ else {
946
+ // update
947
+ this.#moveToTail(index);
948
+ const oldVal = this.#valList[index];
949
+ if (v !== oldVal) {
950
+ if (this.#hasFetchMethod && this.#isBackgroundFetch(oldVal)) {
951
+ oldVal.__abortController.abort(new Error('replaced'));
952
+ const { __staleWhileFetching: s } = oldVal;
953
+ if (s !== undefined && !noDisposeOnSet) {
954
+ if (this.#hasDispose) {
955
+ this.#dispose?.(s, k, 'set');
956
+ }
957
+ if (this.#hasDisposeAfter) {
958
+ this.#disposed?.push([s, k, 'set']);
959
+ }
960
+ }
961
+ }
962
+ else if (!noDisposeOnSet) {
963
+ if (this.#hasDispose) {
964
+ this.#dispose?.(oldVal, k, 'set');
965
+ }
966
+ if (this.#hasDisposeAfter) {
967
+ this.#disposed?.push([oldVal, k, 'set']);
968
+ }
969
+ }
970
+ this.#removeItemSize(index);
971
+ this.#addItemSize(index, size, status);
972
+ this.#valList[index] = v;
973
+ if (status) {
974
+ status.set = 'replace';
975
+ const oldValue = oldVal && this.#isBackgroundFetch(oldVal)
976
+ ? oldVal.__staleWhileFetching
977
+ : oldVal;
978
+ if (oldValue !== undefined)
979
+ status.oldValue = oldValue;
980
+ }
981
+ }
982
+ else if (status) {
983
+ status.set = 'update';
984
+ }
985
+ }
986
+ if (ttl !== 0 && !this.#ttls) {
987
+ this.#initializeTTLTracking();
988
+ }
989
+ if (this.#ttls) {
990
+ if (!noUpdateTTL) {
991
+ this.#setItemTTL(index, ttl, start);
992
+ }
993
+ if (status)
994
+ this.#statusTTL(status, index);
995
+ }
996
+ if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {
997
+ const dt = this.#disposed;
998
+ let task;
999
+ while ((task = dt?.shift())) {
1000
+ this.#disposeAfter?.(...task);
1001
+ }
1002
+ }
1003
+ return this;
1004
+ }
1005
+ /**
1006
+ * Evict the least recently used item, returning its value or
1007
+ * `undefined` if cache is empty.
1008
+ */
1009
+ pop() {
1010
+ try {
1011
+ while (this.#size) {
1012
+ const val = this.#valList[this.#head];
1013
+ this.#evict(true);
1014
+ if (this.#isBackgroundFetch(val)) {
1015
+ if (val.__staleWhileFetching) {
1016
+ return val.__staleWhileFetching;
1017
+ }
1018
+ }
1019
+ else if (val !== undefined) {
1020
+ return val;
1021
+ }
1022
+ }
1023
+ }
1024
+ finally {
1025
+ if (this.#hasDisposeAfter && this.#disposed) {
1026
+ const dt = this.#disposed;
1027
+ let task;
1028
+ while ((task = dt?.shift())) {
1029
+ this.#disposeAfter?.(...task);
1030
+ }
1031
+ }
1032
+ }
1033
+ }
1034
+ #evict(free) {
1035
+ const head = this.#head;
1036
+ const k = this.#keyList[head];
1037
+ const v = this.#valList[head];
1038
+ if (this.#hasFetchMethod && this.#isBackgroundFetch(v)) {
1039
+ v.__abortController.abort(new Error('evicted'));
1040
+ }
1041
+ else if (this.#hasDispose || this.#hasDisposeAfter) {
1042
+ if (this.#hasDispose) {
1043
+ this.#dispose?.(v, k, 'evict');
1044
+ }
1045
+ if (this.#hasDisposeAfter) {
1046
+ this.#disposed?.push([v, k, 'evict']);
1047
+ }
1048
+ }
1049
+ this.#removeItemSize(head);
1050
+ // if we aren't about to use the index, then null these out
1051
+ if (free) {
1052
+ this.#keyList[head] = undefined;
1053
+ this.#valList[head] = undefined;
1054
+ this.#free.push(head);
1055
+ }
1056
+ if (this.#size === 1) {
1057
+ this.#head = this.#tail = 0;
1058
+ this.#free.length = 0;
1059
+ }
1060
+ else {
1061
+ this.#head = this.#next[head];
1062
+ }
1063
+ this.#keyMap.delete(k);
1064
+ this.#size--;
1065
+ return head;
1066
+ }
1067
+ /**
1068
+ * Check if a key is in the cache, without updating the recency of use.
1069
+ * Will return false if the item is stale, even though it is technically
1070
+ * in the cache.
1071
+ *
1072
+ * Check if a key is in the cache, without updating the recency of
1073
+ * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set
1074
+ * to `true` in either the options or the constructor.
1075
+ *
1076
+ * Will return `false` if the item is stale, even though it is technically in
1077
+ * the cache. The difference can be determined (if it matters) by using a
1078
+ * `status` argument, and inspecting the `has` field.
1079
+ *
1080
+ * Will not update item age unless
1081
+ * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.
1082
+ */
1083
+ has(k, hasOptions = {}) {
1084
+ const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions;
1085
+ const index = this.#keyMap.get(k);
1086
+ if (index !== undefined) {
1087
+ const v = this.#valList[index];
1088
+ if (this.#isBackgroundFetch(v) &&
1089
+ v.__staleWhileFetching === undefined) {
1090
+ return false;
1091
+ }
1092
+ if (!this.#isStale(index)) {
1093
+ if (updateAgeOnHas) {
1094
+ this.#updateItemAge(index);
1095
+ }
1096
+ if (status) {
1097
+ status.has = 'hit';
1098
+ this.#statusTTL(status, index);
1099
+ }
1100
+ return true;
1101
+ }
1102
+ else if (status) {
1103
+ status.has = 'stale';
1104
+ this.#statusTTL(status, index);
1105
+ }
1106
+ }
1107
+ else if (status) {
1108
+ status.has = 'miss';
1109
+ }
1110
+ return false;
1111
+ }
1112
+ /**
1113
+ * Like {@link LRUCache#get} but doesn't update recency or delete stale
1114
+ * items.
1115
+ *
1116
+ * Returns `undefined` if the item is stale, unless
1117
+ * {@link LRUCache.OptionsBase.allowStale} is set.
1118
+ */
1119
+ peek(k, peekOptions = {}) {
1120
+ const { allowStale = this.allowStale } = peekOptions;
1121
+ const index = this.#keyMap.get(k);
1122
+ if (index === undefined ||
1123
+ (!allowStale && this.#isStale(index))) {
1124
+ return;
1125
+ }
1126
+ const v = this.#valList[index];
1127
+ // either stale and allowed, or forcing a refresh of non-stale value
1128
+ return this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
1129
+ }
1130
+ #backgroundFetch(k, index, options, context) {
1131
+ const v = index === undefined ? undefined : this.#valList[index];
1132
+ if (this.#isBackgroundFetch(v)) {
1133
+ return v;
1134
+ }
1135
+ const ac = new AC();
1136
+ const { signal } = options;
1137
+ // when/if our AC signals, then stop listening to theirs.
1138
+ signal?.addEventListener('abort', () => ac.abort(signal.reason), {
1139
+ signal: ac.signal,
1140
+ });
1141
+ const fetchOpts = {
1142
+ signal: ac.signal,
1143
+ options,
1144
+ context,
1145
+ };
1146
+ const cb = (v, updateCache = false) => {
1147
+ const { aborted } = ac.signal;
1148
+ const ignoreAbort = options.ignoreFetchAbort && v !== undefined;
1149
+ if (options.status) {
1150
+ if (aborted && !updateCache) {
1151
+ options.status.fetchAborted = true;
1152
+ options.status.fetchError = ac.signal.reason;
1153
+ if (ignoreAbort)
1154
+ options.status.fetchAbortIgnored = true;
1155
+ }
1156
+ else {
1157
+ options.status.fetchResolved = true;
1158
+ }
1159
+ }
1160
+ if (aborted && !ignoreAbort && !updateCache) {
1161
+ return fetchFail(ac.signal.reason);
1162
+ }
1163
+ // either we didn't abort, and are still here, or we did, and ignored
1164
+ const bf = p;
1165
+ if (this.#valList[index] === p) {
1166
+ if (v === undefined) {
1167
+ if (bf.__staleWhileFetching) {
1168
+ this.#valList[index] = bf.__staleWhileFetching;
1169
+ }
1170
+ else {
1171
+ this.#delete(k, 'fetch');
1172
+ }
1173
+ }
1174
+ else {
1175
+ if (options.status)
1176
+ options.status.fetchUpdated = true;
1177
+ this.set(k, v, fetchOpts.options);
1178
+ }
1179
+ }
1180
+ return v;
1181
+ };
1182
+ const eb = (er) => {
1183
+ if (options.status) {
1184
+ options.status.fetchRejected = true;
1185
+ options.status.fetchError = er;
1186
+ }
1187
+ return fetchFail(er);
1188
+ };
1189
+ const fetchFail = (er) => {
1190
+ const { aborted } = ac.signal;
1191
+ const allowStaleAborted = aborted && options.allowStaleOnFetchAbort;
1192
+ const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection;
1193
+ const noDelete = allowStale || options.noDeleteOnFetchRejection;
1194
+ const bf = p;
1195
+ if (this.#valList[index] === p) {
1196
+ // if we allow stale on fetch rejections, then we need to ensure that
1197
+ // the stale value is not removed from the cache when the fetch fails.
1198
+ const del = !noDelete || bf.__staleWhileFetching === undefined;
1199
+ if (del) {
1200
+ this.#delete(k, 'fetch');
1201
+ }
1202
+ else if (!allowStaleAborted) {
1203
+ // still replace the *promise* with the stale value,
1204
+ // since we are done with the promise at this point.
1205
+ // leave it untouched if we're still waiting for an
1206
+ // aborted background fetch that hasn't yet returned.
1207
+ this.#valList[index] = bf.__staleWhileFetching;
1208
+ }
1209
+ }
1210
+ if (allowStale) {
1211
+ if (options.status && bf.__staleWhileFetching !== undefined) {
1212
+ options.status.returnedStale = true;
1213
+ }
1214
+ return bf.__staleWhileFetching;
1215
+ }
1216
+ else if (bf.__returned === bf) {
1217
+ throw er;
1218
+ }
1219
+ };
1220
+ const pcall = (res, rej) => {
1221
+ const fmp = this.#fetchMethod?.(k, v, fetchOpts);
1222
+ if (fmp && fmp instanceof Promise) {
1223
+ fmp.then(v => res(v === undefined ? undefined : v), rej);
1224
+ }
1225
+ // ignored, we go until we finish, regardless.
1226
+ // defer check until we are actually aborting,
1227
+ // so fetchMethod can override.
1228
+ ac.signal.addEventListener('abort', () => {
1229
+ if (!options.ignoreFetchAbort ||
1230
+ options.allowStaleOnFetchAbort) {
1231
+ res(undefined);
1232
+ // when it eventually resolves, update the cache.
1233
+ if (options.allowStaleOnFetchAbort) {
1234
+ res = v => cb(v, true);
1235
+ }
1236
+ }
1237
+ });
1238
+ };
1239
+ if (options.status)
1240
+ options.status.fetchDispatched = true;
1241
+ const p = new Promise(pcall).then(cb, eb);
1242
+ const bf = Object.assign(p, {
1243
+ __abortController: ac,
1244
+ __staleWhileFetching: v,
1245
+ __returned: undefined,
1246
+ });
1247
+ if (index === undefined) {
1248
+ // internal, don't expose status.
1249
+ this.set(k, bf, { ...fetchOpts.options, status: undefined });
1250
+ index = this.#keyMap.get(k);
1251
+ }
1252
+ else {
1253
+ this.#valList[index] = bf;
1254
+ }
1255
+ return bf;
1256
+ }
1257
+ #isBackgroundFetch(p) {
1258
+ if (!this.#hasFetchMethod)
1259
+ return false;
1260
+ const b = p;
1261
+ return (!!b &&
1262
+ b instanceof Promise &&
1263
+ b.hasOwnProperty('__staleWhileFetching') &&
1264
+ b.__abortController instanceof AC);
1265
+ }
1266
+ async fetch(k, fetchOptions = {}) {
1267
+ const {
1268
+ // get options
1269
+ allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet,
1270
+ // set options
1271
+ ttl = this.ttl, noDisposeOnSet = this.noDisposeOnSet, size = 0, sizeCalculation = this.sizeCalculation, noUpdateTTL = this.noUpdateTTL,
1272
+ // fetch exclusive options
1273
+ noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection = this.allowStaleOnFetchRejection, ignoreFetchAbort = this.ignoreFetchAbort, allowStaleOnFetchAbort = this.allowStaleOnFetchAbort, context, forceRefresh = false, status, signal, } = fetchOptions;
1274
+ if (!this.#hasFetchMethod) {
1275
+ if (status)
1276
+ status.fetch = 'get';
1277
+ return this.get(k, {
1278
+ allowStale,
1279
+ updateAgeOnGet,
1280
+ noDeleteOnStaleGet,
1281
+ status,
1282
+ });
1283
+ }
1284
+ const options = {
1285
+ allowStale,
1286
+ updateAgeOnGet,
1287
+ noDeleteOnStaleGet,
1288
+ ttl,
1289
+ noDisposeOnSet,
1290
+ size,
1291
+ sizeCalculation,
1292
+ noUpdateTTL,
1293
+ noDeleteOnFetchRejection,
1294
+ allowStaleOnFetchRejection,
1295
+ allowStaleOnFetchAbort,
1296
+ ignoreFetchAbort,
1297
+ status,
1298
+ signal,
1299
+ };
1300
+ let index = this.#keyMap.get(k);
1301
+ if (index === undefined) {
1302
+ if (status)
1303
+ status.fetch = 'miss';
1304
+ const p = this.#backgroundFetch(k, index, options, context);
1305
+ return (p.__returned = p);
1306
+ }
1307
+ else {
1308
+ // in cache, maybe already fetching
1309
+ const v = this.#valList[index];
1310
+ if (this.#isBackgroundFetch(v)) {
1311
+ const stale = allowStale && v.__staleWhileFetching !== undefined;
1312
+ if (status) {
1313
+ status.fetch = 'inflight';
1314
+ if (stale)
1315
+ status.returnedStale = true;
1316
+ }
1317
+ return stale ? v.__staleWhileFetching : (v.__returned = v);
1318
+ }
1319
+ // if we force a refresh, that means do NOT serve the cached value,
1320
+ // unless we are already in the process of refreshing the cache.
1321
+ const isStale = this.#isStale(index);
1322
+ if (!forceRefresh && !isStale) {
1323
+ if (status)
1324
+ status.fetch = 'hit';
1325
+ this.#moveToTail(index);
1326
+ if (updateAgeOnGet) {
1327
+ this.#updateItemAge(index);
1328
+ }
1329
+ if (status)
1330
+ this.#statusTTL(status, index);
1331
+ return v;
1332
+ }
1333
+ // ok, it is stale or a forced refresh, and not already fetching.
1334
+ // refresh the cache.
1335
+ const p = this.#backgroundFetch(k, index, options, context);
1336
+ const hasStale = p.__staleWhileFetching !== undefined;
1337
+ const staleVal = hasStale && allowStale;
1338
+ if (status) {
1339
+ status.fetch = isStale ? 'stale' : 'refresh';
1340
+ if (staleVal && isStale)
1341
+ status.returnedStale = true;
1342
+ }
1343
+ return staleVal ? p.__staleWhileFetching : (p.__returned = p);
1344
+ }
1345
+ }
1346
+ async forceFetch(k, fetchOptions = {}) {
1347
+ const v = await this.fetch(k, fetchOptions);
1348
+ if (v === undefined)
1349
+ throw new Error('fetch() returned undefined');
1350
+ return v;
1351
+ }
1352
+ memo(k, memoOptions = {}) {
1353
+ const memoMethod = this.#memoMethod;
1354
+ if (!memoMethod) {
1355
+ throw new Error('no memoMethod provided to constructor');
1356
+ }
1357
+ const { context, forceRefresh, ...options } = memoOptions;
1358
+ const v = this.get(k, options);
1359
+ if (!forceRefresh && v !== undefined)
1360
+ return v;
1361
+ const vv = memoMethod(k, v, {
1362
+ options,
1363
+ context,
1364
+ });
1365
+ this.set(k, vv, options);
1366
+ return vv;
1367
+ }
1368
+ /**
1369
+ * Return a value from the cache. Will update the recency of the cache
1370
+ * entry found.
1371
+ *
1372
+ * If the key is not found, get() will return `undefined`.
1373
+ */
1374
+ get(k, getOptions = {}) {
1375
+ const { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status, } = getOptions;
1376
+ const index = this.#keyMap.get(k);
1377
+ if (index !== undefined) {
1378
+ const value = this.#valList[index];
1379
+ const fetching = this.#isBackgroundFetch(value);
1380
+ if (status)
1381
+ this.#statusTTL(status, index);
1382
+ if (this.#isStale(index)) {
1383
+ if (status)
1384
+ status.get = 'stale';
1385
+ // delete only if not an in-flight background fetch
1386
+ if (!fetching) {
1387
+ if (!noDeleteOnStaleGet) {
1388
+ this.#delete(k, 'expire');
1389
+ }
1390
+ if (status && allowStale)
1391
+ status.returnedStale = true;
1392
+ return allowStale ? value : undefined;
1393
+ }
1394
+ else {
1395
+ if (status &&
1396
+ allowStale &&
1397
+ value.__staleWhileFetching !== undefined) {
1398
+ status.returnedStale = true;
1399
+ }
1400
+ return allowStale ? value.__staleWhileFetching : undefined;
1401
+ }
1402
+ }
1403
+ else {
1404
+ if (status)
1405
+ status.get = 'hit';
1406
+ // if we're currently fetching it, we don't actually have it yet
1407
+ // it's not stale, which means this isn't a staleWhileRefetching.
1408
+ // If it's not stale, and fetching, AND has a __staleWhileFetching
1409
+ // value, then that means the user fetched with {forceRefresh:true},
1410
+ // so it's safe to return that value.
1411
+ if (fetching) {
1412
+ return value.__staleWhileFetching;
1413
+ }
1414
+ this.#moveToTail(index);
1415
+ if (updateAgeOnGet) {
1416
+ this.#updateItemAge(index);
1417
+ }
1418
+ return value;
1419
+ }
1420
+ }
1421
+ else if (status) {
1422
+ status.get = 'miss';
1423
+ }
1424
+ }
1425
+ #connect(p, n) {
1426
+ this.#prev[n] = p;
1427
+ this.#next[p] = n;
1428
+ }
1429
+ #moveToTail(index) {
1430
+ // if tail already, nothing to do
1431
+ // if head, move head to next[index]
1432
+ // else
1433
+ // move next[prev[index]] to next[index] (head has no prev)
1434
+ // move prev[next[index]] to prev[index]
1435
+ // prev[index] = tail
1436
+ // next[tail] = index
1437
+ // tail = index
1438
+ if (index !== this.#tail) {
1439
+ if (index === this.#head) {
1440
+ this.#head = this.#next[index];
1441
+ }
1442
+ else {
1443
+ this.#connect(this.#prev[index], this.#next[index]);
1444
+ }
1445
+ this.#connect(this.#tail, index);
1446
+ this.#tail = index;
1447
+ }
1448
+ }
1449
+ /**
1450
+ * Deletes a key out of the cache.
1451
+ *
1452
+ * Returns true if the key was deleted, false otherwise.
1453
+ */
1454
+ delete(k) {
1455
+ return this.#delete(k, 'delete');
1456
+ }
1457
+ #delete(k, reason) {
1458
+ let deleted = false;
1459
+ if (this.#size !== 0) {
1460
+ const index = this.#keyMap.get(k);
1461
+ if (index !== undefined) {
1462
+ deleted = true;
1463
+ if (this.#size === 1) {
1464
+ this.#clear(reason);
1465
+ }
1466
+ else {
1467
+ this.#removeItemSize(index);
1468
+ const v = this.#valList[index];
1469
+ if (this.#isBackgroundFetch(v)) {
1470
+ v.__abortController.abort(new Error('deleted'));
1471
+ }
1472
+ else if (this.#hasDispose || this.#hasDisposeAfter) {
1473
+ if (this.#hasDispose) {
1474
+ this.#dispose?.(v, k, reason);
1475
+ }
1476
+ if (this.#hasDisposeAfter) {
1477
+ this.#disposed?.push([v, k, reason]);
1478
+ }
1479
+ }
1480
+ this.#keyMap.delete(k);
1481
+ this.#keyList[index] = undefined;
1482
+ this.#valList[index] = undefined;
1483
+ if (index === this.#tail) {
1484
+ this.#tail = this.#prev[index];
1485
+ }
1486
+ else if (index === this.#head) {
1487
+ this.#head = this.#next[index];
1488
+ }
1489
+ else {
1490
+ const pi = this.#prev[index];
1491
+ this.#next[pi] = this.#next[index];
1492
+ const ni = this.#next[index];
1493
+ this.#prev[ni] = this.#prev[index];
1494
+ }
1495
+ this.#size--;
1496
+ this.#free.push(index);
1497
+ }
1498
+ }
1499
+ }
1500
+ if (this.#hasDisposeAfter && this.#disposed?.length) {
1501
+ const dt = this.#disposed;
1502
+ let task;
1503
+ while ((task = dt?.shift())) {
1504
+ this.#disposeAfter?.(...task);
1505
+ }
1506
+ }
1507
+ return deleted;
1508
+ }
1509
+ /**
1510
+ * Clear the cache entirely, throwing away all values.
1511
+ */
1512
+ clear() {
1513
+ return this.#clear('delete');
1514
+ }
1515
+ #clear(reason) {
1516
+ for (const index of this.#rindexes({ allowStale: true })) {
1517
+ const v = this.#valList[index];
1518
+ if (this.#isBackgroundFetch(v)) {
1519
+ v.__abortController.abort(new Error('deleted'));
1520
+ }
1521
+ else {
1522
+ const k = this.#keyList[index];
1523
+ if (this.#hasDispose) {
1524
+ this.#dispose?.(v, k, reason);
1525
+ }
1526
+ if (this.#hasDisposeAfter) {
1527
+ this.#disposed?.push([v, k, reason]);
1528
+ }
1529
+ }
1530
+ }
1531
+ this.#keyMap.clear();
1532
+ this.#valList.fill(undefined);
1533
+ this.#keyList.fill(undefined);
1534
+ if (this.#ttls && this.#starts) {
1535
+ this.#ttls.fill(0);
1536
+ this.#starts.fill(0);
1537
+ }
1538
+ if (this.#sizes) {
1539
+ this.#sizes.fill(0);
1540
+ }
1541
+ this.#head = 0;
1542
+ this.#tail = 0;
1543
+ this.#free.length = 0;
1544
+ this.#calculatedSize = 0;
1545
+ this.#size = 0;
1546
+ if (this.#hasDisposeAfter && this.#disposed) {
1547
+ const dt = this.#disposed;
1548
+ let task;
1549
+ while ((task = dt?.shift())) {
1550
+ this.#disposeAfter?.(...task);
1551
+ }
1552
+ }
1553
+ }
1554
+ }
1555
+ //# sourceMappingURL=index.js.map
1556
+
1557
+ /***/ })
1558
+
1559
+ }]);
1560
+ //# sourceMappingURL=vendors-HELM_node_modules_lru-cache_dist_esm_index_js.js.map