handsontable 0.0.0-next-53a190b-20240403 → 0.0.0-next-5a535ed-20240403

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.

Potentially problematic release.


This version of handsontable might be problematic. Click here for more details.

Files changed (284) hide show
  1. package/3rdparty/walkontable/src/calculator/viewportColumns.js +17 -12
  2. package/3rdparty/walkontable/src/calculator/viewportColumns.mjs +17 -12
  3. package/3rdparty/walkontable/src/calculator/viewportRows.js +15 -10
  4. package/3rdparty/walkontable/src/calculator/viewportRows.mjs +15 -10
  5. package/3rdparty/walkontable/src/cell/coords.js +17 -12
  6. package/3rdparty/walkontable/src/cell/coords.mjs +17 -12
  7. package/3rdparty/walkontable/src/cell/range.d.ts +1 -2
  8. package/3rdparty/walkontable/src/cell/range.js +28 -40
  9. package/3rdparty/walkontable/src/cell/range.mjs +28 -40
  10. package/3rdparty/walkontable/src/core/_base.js +1 -1
  11. package/3rdparty/walkontable/src/core/_base.mjs +1 -1
  12. package/3rdparty/walkontable/src/event.js +104 -72
  13. package/3rdparty/walkontable/src/event.mjs +104 -72
  14. package/3rdparty/walkontable/src/overlay/inlineStart.js +1 -15
  15. package/3rdparty/walkontable/src/overlay/inlineStart.mjs +2 -16
  16. package/3rdparty/walkontable/src/overlay/top.js +0 -11
  17. package/3rdparty/walkontable/src/overlay/top.mjs +1 -12
  18. package/3rdparty/walkontable/src/overlays.js +4 -46
  19. package/3rdparty/walkontable/src/overlays.mjs +4 -46
  20. package/3rdparty/walkontable/src/scroll.js +17 -15
  21. package/3rdparty/walkontable/src/scroll.mjs +17 -15
  22. package/3rdparty/walkontable/src/selection/manager.js +69 -48
  23. package/3rdparty/walkontable/src/selection/manager.mjs +69 -48
  24. package/3rdparty/walkontable/src/selection/scanner.js +42 -33
  25. package/3rdparty/walkontable/src/selection/scanner.mjs +42 -33
  26. package/3rdparty/walkontable/src/utils/columnStretching.js +44 -27
  27. package/3rdparty/walkontable/src/utils/columnStretching.mjs +44 -27
  28. package/3rdparty/walkontable/src/utils/orderView/view.js +1 -1
  29. package/3rdparty/walkontable/src/utils/orderView/view.mjs +1 -1
  30. package/base.js +2 -2
  31. package/base.mjs +2 -2
  32. package/core/viewportScroll/index.js +1 -4
  33. package/core/viewportScroll/index.mjs +1 -4
  34. package/core.d.ts +3 -4
  35. package/core.js +22 -77
  36. package/core.mjs +22 -77
  37. package/dataMap/dataSource.js +1 -1
  38. package/dataMap/dataSource.mjs +1 -1
  39. package/dataMap/metaManager/metaLayers/cellMeta.js +1 -1
  40. package/dataMap/metaManager/metaLayers/cellMeta.mjs +1 -1
  41. package/dataMap/metaManager/metaSchema.js +1 -1
  42. package/dataMap/metaManager/metaSchema.mjs +1 -1
  43. package/dataMap/replaceData.js +1 -1
  44. package/dataMap/replaceData.mjs +1 -1
  45. package/dist/handsontable.css +4 -4
  46. package/dist/handsontable.full.css +4 -4
  47. package/dist/handsontable.full.js +9121 -9062
  48. package/dist/handsontable.full.min.css +3 -3
  49. package/dist/handsontable.full.min.js +292 -292
  50. package/dist/handsontable.js +6573 -6967
  51. package/dist/handsontable.min.css +3 -3
  52. package/dist/handsontable.min.js +25 -25
  53. package/dist/languages/all.min.js +1 -1
  54. package/dist/languages/ar-AR.min.js +1 -1
  55. package/dist/languages/cs-CZ.min.js +1 -1
  56. package/dist/languages/de-CH.min.js +1 -1
  57. package/dist/languages/de-DE.min.js +1 -1
  58. package/dist/languages/en-US.min.js +1 -1
  59. package/dist/languages/es-MX.min.js +1 -1
  60. package/dist/languages/fr-FR.min.js +1 -1
  61. package/dist/languages/hr-HR.min.js +1 -1
  62. package/dist/languages/it-IT.min.js +1 -1
  63. package/dist/languages/ja-JP.min.js +1 -1
  64. package/dist/languages/ko-KR.min.js +1 -1
  65. package/dist/languages/lv-LV.min.js +1 -1
  66. package/dist/languages/nb-NO.min.js +1 -1
  67. package/dist/languages/nl-NL.min.js +1 -1
  68. package/dist/languages/pl-PL.min.js +1 -1
  69. package/dist/languages/pt-BR.min.js +1 -1
  70. package/dist/languages/ru-RU.min.js +1 -1
  71. package/dist/languages/sr-SP.min.js +1 -1
  72. package/dist/languages/zh-CN.min.js +1 -1
  73. package/dist/languages/zh-TW.min.js +1 -1
  74. package/editorManager.js +23 -25
  75. package/editorManager.mjs +23 -25
  76. package/editors/autocompleteEditor/autocompleteEditor.js +10 -6
  77. package/editors/autocompleteEditor/autocompleteEditor.mjs +10 -6
  78. package/editors/selectEditor/selectEditor.js +19 -20
  79. package/editors/selectEditor/selectEditor.mjs +19 -20
  80. package/eventManager.js +1 -1
  81. package/eventManager.mjs +1 -1
  82. package/focusManager.js +82 -64
  83. package/focusManager.mjs +82 -64
  84. package/helpers/dom/element.js +1 -23
  85. package/helpers/dom/element.mjs +1 -21
  86. package/helpers/mixed.js +1 -1
  87. package/helpers/mixed.mjs +1 -1
  88. package/helpers/object.js +2 -2
  89. package/helpers/object.mjs +2 -2
  90. package/index.d.ts +0 -10
  91. package/package.json +2 -7
  92. package/pluginHooks.d.ts +3 -4
  93. package/pluginHooks.js +38 -99
  94. package/pluginHooks.mjs +38 -99
  95. package/plugins/autoColumnSize/autoColumnSize.js +65 -49
  96. package/plugins/autoColumnSize/autoColumnSize.mjs +65 -49
  97. package/plugins/autoRowSize/autoRowSize.js +34 -28
  98. package/plugins/autoRowSize/autoRowSize.mjs +34 -28
  99. package/plugins/autofill/autofill.js +38 -30
  100. package/plugins/autofill/autofill.mjs +38 -30
  101. package/plugins/base/base.js +17 -12
  102. package/plugins/base/base.mjs +17 -12
  103. package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.js +5 -5
  104. package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.mjs +5 -5
  105. package/plugins/collapsibleColumns/collapsibleColumns.js +50 -59
  106. package/plugins/collapsibleColumns/collapsibleColumns.mjs +50 -59
  107. package/plugins/columnSorting/columnSorting.js +45 -49
  108. package/plugins/columnSorting/columnSorting.mjs +45 -49
  109. package/plugins/columnSummary/columnSummary.js +26 -22
  110. package/plugins/columnSummary/columnSummary.mjs +26 -22
  111. package/plugins/comments/comments.js +158 -116
  112. package/plugins/comments/comments.mjs +158 -116
  113. package/plugins/contextMenu/contextMenu.js +26 -20
  114. package/plugins/contextMenu/contextMenu.mjs +26 -20
  115. package/plugins/contextMenu/itemsFactory.js +1 -1
  116. package/plugins/contextMenu/itemsFactory.mjs +1 -1
  117. package/plugins/contextMenu/menu/defaultShortcutsList.js +10 -26
  118. package/plugins/contextMenu/menu/defaultShortcutsList.mjs +10 -26
  119. package/plugins/contextMenu/menu/menu.js +21 -13
  120. package/plugins/contextMenu/menu/menu.mjs +21 -13
  121. package/plugins/contextMenu/menu/positioner.js +58 -41
  122. package/plugins/contextMenu/menu/positioner.mjs +58 -41
  123. package/plugins/copyPaste/copyPaste.js +157 -116
  124. package/plugins/copyPaste/copyPaste.mjs +157 -116
  125. package/plugins/copyPaste/copyableRanges.js +66 -43
  126. package/plugins/copyPaste/copyableRanges.mjs +66 -43
  127. package/plugins/customBorders/customBorders.js +13 -11
  128. package/plugins/customBorders/customBorders.mjs +13 -11
  129. package/plugins/dragToScroll/dragToScroll.js +6 -6
  130. package/plugins/dragToScroll/dragToScroll.mjs +6 -6
  131. package/plugins/dropdownMenu/dropdownMenu.js +106 -80
  132. package/plugins/dropdownMenu/dropdownMenu.mjs +106 -80
  133. package/plugins/exportFile/dataProvider.js +1 -1
  134. package/plugins/exportFile/dataProvider.mjs +1 -1
  135. package/plugins/filters/component/actionBar.js +9 -9
  136. package/plugins/filters/component/actionBar.mjs +8 -8
  137. package/plugins/filters/component/condition.js +15 -13
  138. package/plugins/filters/component/condition.mjs +15 -13
  139. package/plugins/filters/component/operators.js +6 -6
  140. package/plugins/filters/component/operators.mjs +6 -6
  141. package/plugins/filters/component/value.js +28 -24
  142. package/plugins/filters/component/value.mjs +28 -24
  143. package/plugins/filters/conditionUpdateObserver.js +24 -22
  144. package/plugins/filters/conditionUpdateObserver.mjs +24 -22
  145. package/plugins/filters/dataFilter.js +1 -1
  146. package/plugins/filters/dataFilter.mjs +1 -1
  147. package/plugins/filters/filters.js +95 -81
  148. package/plugins/filters/filters.mjs +95 -81
  149. package/plugins/filters/ui/input.js +19 -13
  150. package/plugins/filters/ui/input.mjs +19 -13
  151. package/plugins/filters/ui/link.js +13 -8
  152. package/plugins/filters/ui/link.mjs +13 -8
  153. package/plugins/filters/ui/multipleSelect.js +112 -85
  154. package/plugins/filters/ui/multipleSelect.mjs +112 -85
  155. package/plugins/filters/ui/radioInput.js +20 -12
  156. package/plugins/filters/ui/radioInput.mjs +20 -12
  157. package/plugins/filters/ui/select.js +72 -50
  158. package/plugins/filters/ui/select.mjs +71 -49
  159. package/plugins/formulas/formulas.js +326 -268
  160. package/plugins/formulas/formulas.mjs +327 -269
  161. package/plugins/formulas/indexSyncer/axisSyncer.js +61 -38
  162. package/plugins/formulas/indexSyncer/axisSyncer.mjs +61 -38
  163. package/plugins/formulas/indexSyncer/index.js +48 -25
  164. package/plugins/formulas/indexSyncer/index.mjs +48 -25
  165. package/plugins/hiddenColumns/hiddenColumns.js +83 -64
  166. package/plugins/hiddenColumns/hiddenColumns.mjs +83 -64
  167. package/plugins/hiddenRows/hiddenRows.js +82 -63
  168. package/plugins/hiddenRows/hiddenRows.mjs +82 -63
  169. package/plugins/manualColumnFreeze/manualColumnFreeze.js +32 -24
  170. package/plugins/manualColumnFreeze/manualColumnFreeze.mjs +33 -25
  171. package/plugins/manualColumnMove/manualColumnMove.js +170 -126
  172. package/plugins/manualColumnMove/manualColumnMove.mjs +170 -126
  173. package/plugins/manualColumnResize/manualColumnResize.js +230 -169
  174. package/plugins/manualColumnResize/manualColumnResize.mjs +230 -169
  175. package/plugins/manualRowMove/manualRowMove.js +128 -99
  176. package/plugins/manualRowMove/manualRowMove.mjs +128 -99
  177. package/plugins/manualRowResize/manualRowResize.js +209 -150
  178. package/plugins/manualRowResize/manualRowResize.mjs +209 -150
  179. package/plugins/mergeCells/calculations/selection.js +71 -2
  180. package/plugins/mergeCells/calculations/selection.mjs +71 -2
  181. package/plugins/mergeCells/cellsCollection.js +1 -117
  182. package/plugins/mergeCells/cellsCollection.mjs +1 -117
  183. package/plugins/mergeCells/contextMenuItem/toggleMerge.js +1 -11
  184. package/plugins/mergeCells/contextMenuItem/toggleMerge.mjs +1 -11
  185. package/plugins/mergeCells/mergeCells.js +397 -499
  186. package/plugins/mergeCells/mergeCells.mjs +397 -499
  187. package/plugins/multiColumnSorting/multiColumnSorting.js +2 -8
  188. package/plugins/multiColumnSorting/multiColumnSorting.mjs +2 -8
  189. package/plugins/multipleSelectionHandles/multipleSelectionHandles.js +1 -1
  190. package/plugins/multipleSelectionHandles/multipleSelectionHandles.mjs +1 -1
  191. package/plugins/nestedHeaders/nestedHeaders.js +253 -205
  192. package/plugins/nestedHeaders/nestedHeaders.mjs +254 -206
  193. package/plugins/nestedHeaders/stateManager/headersTree.js +32 -21
  194. package/plugins/nestedHeaders/stateManager/headersTree.mjs +32 -21
  195. package/plugins/nestedHeaders/stateManager/index.js +41 -30
  196. package/plugins/nestedHeaders/stateManager/index.mjs +41 -30
  197. package/plugins/nestedHeaders/stateManager/sourceSettings.js +30 -19
  198. package/plugins/nestedHeaders/stateManager/sourceSettings.mjs +30 -19
  199. package/plugins/nestedRows/data/dataManager.js +1 -1
  200. package/plugins/nestedRows/data/dataManager.mjs +1 -1
  201. package/plugins/nestedRows/nestedRows.js +182 -151
  202. package/plugins/nestedRows/nestedRows.mjs +183 -152
  203. package/plugins/nestedRows/ui/contextMenu.js +15 -11
  204. package/plugins/nestedRows/ui/contextMenu.mjs +14 -10
  205. package/plugins/nestedRows/utils/rowMoveController.js +1 -1
  206. package/plugins/nestedRows/utils/rowMoveController.mjs +1 -1
  207. package/plugins/persistentState/storage.js +2 -2
  208. package/plugins/persistentState/storage.mjs +2 -2
  209. package/plugins/search/search.js +7 -7
  210. package/plugins/search/search.mjs +7 -7
  211. package/plugins/touchScroll/touchScroll.js +19 -15
  212. package/plugins/touchScroll/touchScroll.mjs +20 -16
  213. package/plugins/trimRows/trimRows.js +6 -6
  214. package/plugins/trimRows/trimRows.mjs +6 -6
  215. package/renderers/checkboxRenderer/checkboxRenderer.js +5 -8
  216. package/renderers/checkboxRenderer/checkboxRenderer.mjs +5 -8
  217. package/selection/highlight/highlight.js +14 -14
  218. package/selection/highlight/highlight.mjs +13 -13
  219. package/selection/highlight/visualSelection.js +0 -2
  220. package/selection/highlight/visualSelection.mjs +0 -2
  221. package/selection/selection.js +67 -225
  222. package/selection/selection.mjs +66 -224
  223. package/selection/transformation.js +118 -149
  224. package/selection/transformation.mjs +118 -149
  225. package/shortcutContexts/commands/editor/closeAndSave.js +2 -2
  226. package/shortcutContexts/commands/editor/closeAndSave.mjs +2 -2
  227. package/shortcutContexts/commands/editor/open.js +3 -18
  228. package/shortcutContexts/commands/editor/open.mjs +3 -18
  229. package/shortcutContexts/commands/extendCellsSelection/down.js +1 -1
  230. package/shortcutContexts/commands/extendCellsSelection/down.mjs +1 -1
  231. package/shortcutContexts/commands/extendCellsSelection/left.js +1 -1
  232. package/shortcutContexts/commands/extendCellsSelection/left.mjs +1 -1
  233. package/shortcutContexts/commands/extendCellsSelection/right.js +1 -1
  234. package/shortcutContexts/commands/extendCellsSelection/right.mjs +1 -1
  235. package/shortcutContexts/commands/extendCellsSelection/toColumns.js +1 -1
  236. package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +1 -1
  237. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +1 -3
  238. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +1 -3
  239. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +3 -9
  240. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +3 -9
  241. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +3 -10
  242. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +3 -10
  243. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +1 -3
  244. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +1 -3
  245. package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +1 -3
  246. package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +1 -3
  247. package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +1 -3
  248. package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +1 -3
  249. package/shortcutContexts/commands/extendCellsSelection/toRows.js +1 -1
  250. package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +1 -1
  251. package/shortcutContexts/commands/extendCellsSelection/up.js +1 -1
  252. package/shortcutContexts/commands/extendCellsSelection/up.mjs +1 -1
  253. package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +1 -6
  254. package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +1 -6
  255. package/shortcutContexts/commands/moveCellSelection/inlineStart.js +1 -6
  256. package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +1 -6
  257. package/shortcutContexts/grid.js +3 -9
  258. package/shortcutContexts/grid.mjs +3 -9
  259. package/shortcuts/context.js +1 -2
  260. package/shortcuts/context.mjs +1 -2
  261. package/tableView.js +78 -52
  262. package/tableView.mjs +78 -52
  263. package/translations/changesObservable/observable.js +38 -21
  264. package/translations/changesObservable/observable.mjs +38 -21
  265. package/translations/changesObservable/observer.js +12 -7
  266. package/translations/changesObservable/observer.mjs +11 -6
  267. package/translations/mapCollections/aggregatedCollection.js +1 -1
  268. package/translations/mapCollections/aggregatedCollection.mjs +1 -1
  269. package/translations/maps/indexMap.js +1 -1
  270. package/translations/maps/indexMap.mjs +1 -1
  271. package/utils/dataStructures/linkedList.js +1 -6
  272. package/utils/dataStructures/linkedList.mjs +1 -6
  273. package/utils/dataStructures/tree.js +1 -1
  274. package/utils/dataStructures/tree.mjs +1 -1
  275. package/utils/interval.js +44 -26
  276. package/utils/interval.mjs +44 -26
  277. package/core/viewportScroll/scrollStrategies/focusScroll.js +0 -15
  278. package/core/viewportScroll/scrollStrategies/focusScroll.mjs +0 -11
  279. package/i18n/languages/ar-AR.d.ts +0 -5
  280. package/i18n/languages/cs-CZ.d.ts +0 -5
  281. package/i18n/languages/hr-HR.d.ts +0 -5
  282. package/i18n/languages/sr-SP.d.ts +0 -5
  283. package/plugins/mergeCells/focusOrder.js +0 -305
  284. package/plugins/mergeCells/focusOrder.mjs +0 -300
@@ -1,10 +1,12 @@
1
- import "core-js/modules/es.error.cause.js";
2
1
  import "core-js/modules/es.array.push.js";
2
+ import "core-js/modules/es.error.cause.js";
3
3
  function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
4
4
  function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
5
- function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
6
- function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
7
- function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
5
+ function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
6
+ function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
7
+ function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
8
+ function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
9
+ function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
8
10
  import { arrayMap, arrayReduce } from "../../../helpers/array.mjs";
9
11
  import SourceSettings from "./sourceSettings.mjs";
10
12
  import HeadersTree from "./headersTree.mjs";
@@ -50,21 +52,30 @@ export default class StateManager {
50
52
  * @private
51
53
  * @type {SourceSettings}
52
54
  */
53
- _classPrivateFieldInitSpec(this, _sourceSettings, new SourceSettings());
55
+ _classPrivateFieldInitSpec(this, _sourceSettings, {
56
+ writable: true,
57
+ value: new SourceSettings()
58
+ });
54
59
  /**
55
60
  * The instance of the headers tree. The tree is generated after setting new configuration data.
56
61
  *
57
62
  * @private
58
63
  * @type {HeadersTree}
59
64
  */
60
- _classPrivateFieldInitSpec(this, _headersTree, new HeadersTree(_classPrivateFieldGet(_sourceSettings, this)));
65
+ _classPrivateFieldInitSpec(this, _headersTree, {
66
+ writable: true,
67
+ value: new HeadersTree(_classPrivateFieldGet(this, _sourceSettings))
68
+ });
61
69
  /**
62
70
  * Cached matrix which is generated from the tree structure.
63
71
  *
64
72
  * @private
65
73
  * @type {Array[]}
66
74
  */
67
- _classPrivateFieldInitSpec(this, _stateMatrix, [[]]);
75
+ _classPrivateFieldInitSpec(this, _stateMatrix, {
76
+ writable: true,
77
+ value: [[]]
78
+ });
68
79
  }
69
80
  /**
70
81
  * Sets a new state for the nested headers plugin based on settings passed
@@ -74,16 +85,16 @@ export default class StateManager {
74
85
  * @returns {boolean} Returns `true` if the settings are processed correctly, `false` otherwise.
75
86
  */
76
87
  setState(nestedHeadersSettings) {
77
- _classPrivateFieldGet(_sourceSettings, this).setData(nestedHeadersSettings);
88
+ _classPrivateFieldGet(this, _sourceSettings).setData(nestedHeadersSettings);
78
89
  let hasError = false;
79
90
  try {
80
- _classPrivateFieldGet(_headersTree, this).buildTree();
91
+ _classPrivateFieldGet(this, _headersTree).buildTree();
81
92
  } catch (ex) {
82
- _classPrivateFieldGet(_headersTree, this).clear();
83
- _classPrivateFieldGet(_sourceSettings, this).clear();
93
+ _classPrivateFieldGet(this, _headersTree).clear();
94
+ _classPrivateFieldGet(this, _sourceSettings).clear();
84
95
  hasError = true;
85
96
  }
86
- _classPrivateFieldSet(_stateMatrix, this, generateMatrix(_classPrivateFieldGet(_headersTree, this).getRoots()));
97
+ _classPrivateFieldSet(this, _stateMatrix, generateMatrix(_classPrivateFieldGet(this, _headersTree).getRoots()));
87
98
  return hasError;
88
99
  }
89
100
 
@@ -94,7 +105,7 @@ export default class StateManager {
94
105
  * @param {number} columnsCount The number of columns to limit to.
95
106
  */
96
107
  setColumnsLimit(columnsCount) {
97
- _classPrivateFieldGet(_sourceSettings, this).setColumnsLimit(columnsCount);
108
+ _classPrivateFieldGet(this, _sourceSettings).setColumnsLimit(columnsCount);
98
109
  }
99
110
 
100
111
  /**
@@ -118,9 +129,9 @@ export default class StateManager {
118
129
  ...rest
119
130
  };
120
131
  });
121
- _classPrivateFieldGet(_sourceSettings, this).mergeWith(transformedSettings);
122
- _classPrivateFieldGet(_headersTree, this).buildTree();
123
- _classPrivateFieldSet(_stateMatrix, this, generateMatrix(_classPrivateFieldGet(_headersTree, this).getRoots()));
132
+ _classPrivateFieldGet(this, _sourceSettings).mergeWith(transformedSettings);
133
+ _classPrivateFieldGet(this, _headersTree).buildTree();
134
+ _classPrivateFieldSet(this, _stateMatrix, generateMatrix(_classPrivateFieldGet(this, _headersTree).getRoots()));
124
135
  }
125
136
 
126
137
  /**
@@ -135,9 +146,9 @@ export default class StateManager {
135
146
  * header settings.
136
147
  */
137
148
  mapState(callback) {
138
- _classPrivateFieldGet(_sourceSettings, this).map(callback);
139
- _classPrivateFieldGet(_headersTree, this).buildTree();
140
- _classPrivateFieldSet(_stateMatrix, this, generateMatrix(_classPrivateFieldGet(_headersTree, this).getRoots()));
149
+ _classPrivateFieldGet(this, _sourceSettings).map(callback);
150
+ _classPrivateFieldGet(this, _headersTree).buildTree();
151
+ _classPrivateFieldSet(this, _stateMatrix, generateMatrix(_classPrivateFieldGet(this, _headersTree).getRoots()));
141
152
  }
142
153
 
143
154
  /**
@@ -150,7 +161,7 @@ export default class StateManager {
150
161
  * @returns {Array}
151
162
  */
152
163
  mapNodes(callback) {
153
- return arrayReduce(_classPrivateFieldGet(_headersTree, this).getRoots(), (acc, rootNode) => {
164
+ return arrayReduce(_classPrivateFieldGet(this, _headersTree).getRoots(), (acc, rootNode) => {
154
165
  rootNode.walkDown(node => {
155
166
  const result = callback(node.data);
156
167
  if (result !== undefined) {
@@ -175,13 +186,13 @@ export default class StateManager {
175
186
  if (headerLevel < 0) {
176
187
  headerLevel = this.rowCoordsToLevel(headerLevel);
177
188
  }
178
- const nodeToProcess = _classPrivateFieldGet(_headersTree, this).getNode(headerLevel, columnIndex);
189
+ const nodeToProcess = _classPrivateFieldGet(this, _headersTree).getNode(headerLevel, columnIndex);
179
190
  let actionResult;
180
191
  if (nodeToProcess) {
181
192
  actionResult = triggerNodeModification(action, nodeToProcess, columnIndex);
182
193
 
183
194
  // TODO (perf-tip): Trigger matrix generation once after multiple node modifications.
184
- _classPrivateFieldSet(_stateMatrix, this, generateMatrix(_classPrivateFieldGet(_headersTree, this).getRoots()));
195
+ _classPrivateFieldSet(this, _stateMatrix, generateMatrix(_classPrivateFieldGet(this, _headersTree).getRoots()));
185
196
  }
186
197
  return actionResult;
187
198
  }
@@ -290,7 +301,7 @@ export default class StateManager {
290
301
  if (headerLevel === null || headerLevel >= this.getLayersCount()) {
291
302
  return null;
292
303
  }
293
- return (_classPrivateFieldGet2 = (_classPrivateFieldGet3 = _classPrivateFieldGet(_stateMatrix, this)[headerLevel]) === null || _classPrivateFieldGet3 === void 0 ? void 0 : _classPrivateFieldGet3[columnIndex]) !== null && _classPrivateFieldGet2 !== void 0 ? _classPrivateFieldGet2 : null;
304
+ return (_classPrivateFieldGet2 = (_classPrivateFieldGet3 = _classPrivateFieldGet(this, _stateMatrix)[headerLevel]) === null || _classPrivateFieldGet3 === void 0 ? void 0 : _classPrivateFieldGet3[columnIndex]) !== null && _classPrivateFieldGet2 !== void 0 ? _classPrivateFieldGet2 : null;
294
305
  }
295
306
 
296
307
  /**
@@ -326,7 +337,7 @@ export default class StateManager {
326
337
  if (headerLevel === null || headerLevel >= this.getLayersCount()) {
327
338
  return null;
328
339
  }
329
- const node = _classPrivateFieldGet(_headersTree, this).getNode(headerLevel, columnIndex);
340
+ const node = _classPrivateFieldGet(this, _headersTree).getNode(headerLevel, columnIndex);
330
341
  if (!node) {
331
342
  return null;
332
343
  }
@@ -349,7 +360,7 @@ export default class StateManager {
349
360
  let atLeastOneRootFound = false;
350
361
  let headerLevel = null;
351
362
  for (let columnIndex = columnIndexFrom; columnIndex <= columnIndexTo; columnIndex++) {
352
- const rootNode = _classPrivateFieldGet(_headersTree, this).getRootByColumn(columnIndex);
363
+ const rootNode = _classPrivateFieldGet(this, _headersTree).getRootByColumn(columnIndex);
353
364
  if (!rootNode) {
354
365
  break;
355
366
  }
@@ -457,7 +468,7 @@ export default class StateManager {
457
468
  * @returns {number}
458
469
  */
459
470
  getLayersCount() {
460
- return _classPrivateFieldGet(_sourceSettings, this).getLayersCount();
471
+ return _classPrivateFieldGet(this, _sourceSettings).getLayersCount();
461
472
  }
462
473
 
463
474
  /**
@@ -466,15 +477,15 @@ export default class StateManager {
466
477
  * @returns {number}
467
478
  */
468
479
  getColumnsCount() {
469
- return _classPrivateFieldGet(_sourceSettings, this).getColumnsCount();
480
+ return _classPrivateFieldGet(this, _sourceSettings).getColumnsCount();
470
481
  }
471
482
 
472
483
  /**
473
484
  * Clears the column state manager to the initial state.
474
485
  */
475
486
  clear() {
476
- _classPrivateFieldSet(_stateMatrix, this, []);
477
- _classPrivateFieldGet(_sourceSettings, this).clear();
478
- _classPrivateFieldGet(_headersTree, this).clear();
487
+ _classPrivateFieldSet(this, _stateMatrix, []);
488
+ _classPrivateFieldGet(this, _sourceSettings).clear();
489
+ _classPrivateFieldGet(this, _headersTree).clear();
479
490
  }
480
491
  }
@@ -8,9 +8,11 @@ var _array = require("../../../helpers/array");
8
8
  var _settingsNormalizer = require("./settingsNormalizer");
9
9
  function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
10
10
  function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
11
- function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
12
- function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
13
- function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
11
+ function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
12
+ function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
13
+ function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
14
+ function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
15
+ function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
14
16
  /**
15
17
  * List of properties which are configurable. That properties can be changed using public API.
16
18
  *
@@ -37,14 +39,20 @@ class SourceSettings {
37
39
  * @private
38
40
  * @type {Array[]}
39
41
  */
40
- _classPrivateFieldInitSpec(this, _data, []);
42
+ _classPrivateFieldInitSpec(this, _data, {
43
+ writable: true,
44
+ value: []
45
+ });
41
46
  /**
42
47
  * The total length of the nested header layers.
43
48
  *
44
49
  * @private
45
50
  * @type {number}
46
51
  */
47
- _classPrivateFieldInitSpec(this, _dataLength, 0);
52
+ _classPrivateFieldInitSpec(this, _dataLength, {
53
+ writable: true,
54
+ value: 0
55
+ });
48
56
  /**
49
57
  * Columns count limit value trims source settings to that value. If columns
50
58
  * count limit intersects nested header, the header's colspan value is reduced
@@ -52,7 +60,10 @@ class SourceSettings {
52
60
  *
53
61
  * @type {number}
54
62
  */
55
- _classPrivateFieldInitSpec(this, _columnsLimit, Infinity);
63
+ _classPrivateFieldInitSpec(this, _columnsLimit, {
64
+ writable: true,
65
+ value: Infinity
66
+ });
56
67
  }
57
68
  /**
58
69
  * Sets columns limit to the source settings will be trimmed. All headers which
@@ -61,7 +72,7 @@ class SourceSettings {
61
72
  * @param {number} columnsCount The number of columns to limit to.
62
73
  */
63
74
  setColumnsLimit(columnsCount) {
64
- _classPrivateFieldSet(_columnsLimit, this, columnsCount);
75
+ _classPrivateFieldSet(this, _columnsLimit, columnsCount);
65
76
  }
66
77
 
67
78
  /**
@@ -71,8 +82,8 @@ class SourceSettings {
71
82
  */
72
83
  setData() {
73
84
  let nestedHeadersSettings = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
74
- _classPrivateFieldSet(_data, this, (0, _settingsNormalizer.normalizeSettings)(nestedHeadersSettings, _classPrivateFieldGet(_columnsLimit, this)));
75
- _classPrivateFieldSet(_dataLength, this, _classPrivateFieldGet(_data, this).length);
85
+ _classPrivateFieldSet(this, _data, (0, _settingsNormalizer.normalizeSettings)(nestedHeadersSettings, _classPrivateFieldGet(this, _columnsLimit)));
86
+ _classPrivateFieldSet(this, _dataLength, _classPrivateFieldGet(this, _data).length);
76
87
  }
77
88
 
78
89
  /**
@@ -81,7 +92,7 @@ class SourceSettings {
81
92
  * @returns {Array[]}
82
93
  */
83
94
  getData() {
84
- return _classPrivateFieldGet(_data, this);
95
+ return _classPrivateFieldGet(this, _data);
85
96
  }
86
97
 
87
98
  /**
@@ -113,7 +124,7 @@ class SourceSettings {
113
124
  * header settings.
114
125
  */
115
126
  map(callback) {
116
- (0, _array.arrayEach)(_classPrivateFieldGet(_data, this), header => {
127
+ (0, _array.arrayEach)(_classPrivateFieldGet(this, _data), header => {
117
128
  (0, _array.arrayEach)(header, headerSettings => {
118
129
  const propsToExtend = callback({
119
130
  ...headerSettings
@@ -136,10 +147,10 @@ class SourceSettings {
136
147
  */
137
148
  getHeaderSettings(headerLevel, columnIndex) {
138
149
  var _headersSettings$colu;
139
- if (headerLevel >= _classPrivateFieldGet(_dataLength, this) || headerLevel < 0) {
150
+ if (headerLevel >= _classPrivateFieldGet(this, _dataLength) || headerLevel < 0) {
140
151
  return null;
141
152
  }
142
- const headersSettings = _classPrivateFieldGet(_data, this)[headerLevel];
153
+ const headersSettings = _classPrivateFieldGet(this, _data)[headerLevel];
143
154
  if (Array.isArray(headersSettings) === false || columnIndex >= headersSettings.length) {
144
155
  return null;
145
156
  }
@@ -159,10 +170,10 @@ class SourceSettings {
159
170
  getHeadersSettings(headerLevel, columnIndex) {
160
171
  let columnsLength = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
161
172
  const headersSettingsChunks = [];
162
- if (headerLevel >= _classPrivateFieldGet(_dataLength, this) || headerLevel < 0) {
173
+ if (headerLevel >= _classPrivateFieldGet(this, _dataLength) || headerLevel < 0) {
163
174
  return headersSettingsChunks;
164
175
  }
165
- const headersSettings = _classPrivateFieldGet(_data, this)[headerLevel];
176
+ const headersSettings = _classPrivateFieldGet(this, _data)[headerLevel];
166
177
  let currentLength = 0;
167
178
  for (let i = columnIndex; i < headersSettings.length; i++) {
168
179
  const headerSettings = headersSettings[i];
@@ -193,7 +204,7 @@ class SourceSettings {
193
204
  * @returns {number}
194
205
  */
195
206
  getLayersCount() {
196
- return _classPrivateFieldGet(_dataLength, this);
207
+ return _classPrivateFieldGet(this, _dataLength);
197
208
  }
198
209
 
199
210
  /**
@@ -202,15 +213,15 @@ class SourceSettings {
202
213
  * @returns {number}
203
214
  */
204
215
  getColumnsCount() {
205
- return _classPrivateFieldGet(_dataLength, this) > 0 ? _classPrivateFieldGet(_data, this)[0].length : 0;
216
+ return _classPrivateFieldGet(this, _dataLength) > 0 ? _classPrivateFieldGet(this, _data)[0].length : 0;
206
217
  }
207
218
 
208
219
  /**
209
220
  * Clears the data.
210
221
  */
211
222
  clear() {
212
- _classPrivateFieldSet(_data, this, []);
213
- _classPrivateFieldSet(_dataLength, this, 0);
223
+ _classPrivateFieldSet(this, _data, []);
224
+ _classPrivateFieldSet(this, _dataLength, 0);
214
225
  }
215
226
  }
216
227
  exports.default = SourceSettings;
@@ -2,9 +2,11 @@ import "core-js/modules/es.error.cause.js";
2
2
  import "core-js/modules/es.array.push.js";
3
3
  function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
4
4
  function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
5
- function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
6
- function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
7
- function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
5
+ function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
6
+ function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
7
+ function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
8
+ function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
9
+ function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
8
10
  import { extend, isObject } from "../../../helpers/object.mjs";
9
11
  import { arrayEach } from "../../../helpers/array.mjs";
10
12
  import { normalizeSettings } from "./settingsNormalizer.mjs";
@@ -34,14 +36,20 @@ export default class SourceSettings {
34
36
  * @private
35
37
  * @type {Array[]}
36
38
  */
37
- _classPrivateFieldInitSpec(this, _data, []);
39
+ _classPrivateFieldInitSpec(this, _data, {
40
+ writable: true,
41
+ value: []
42
+ });
38
43
  /**
39
44
  * The total length of the nested header layers.
40
45
  *
41
46
  * @private
42
47
  * @type {number}
43
48
  */
44
- _classPrivateFieldInitSpec(this, _dataLength, 0);
49
+ _classPrivateFieldInitSpec(this, _dataLength, {
50
+ writable: true,
51
+ value: 0
52
+ });
45
53
  /**
46
54
  * Columns count limit value trims source settings to that value. If columns
47
55
  * count limit intersects nested header, the header's colspan value is reduced
@@ -49,7 +57,10 @@ export default class SourceSettings {
49
57
  *
50
58
  * @type {number}
51
59
  */
52
- _classPrivateFieldInitSpec(this, _columnsLimit, Infinity);
60
+ _classPrivateFieldInitSpec(this, _columnsLimit, {
61
+ writable: true,
62
+ value: Infinity
63
+ });
53
64
  }
54
65
  /**
55
66
  * Sets columns limit to the source settings will be trimmed. All headers which
@@ -58,7 +69,7 @@ export default class SourceSettings {
58
69
  * @param {number} columnsCount The number of columns to limit to.
59
70
  */
60
71
  setColumnsLimit(columnsCount) {
61
- _classPrivateFieldSet(_columnsLimit, this, columnsCount);
72
+ _classPrivateFieldSet(this, _columnsLimit, columnsCount);
62
73
  }
63
74
 
64
75
  /**
@@ -68,8 +79,8 @@ export default class SourceSettings {
68
79
  */
69
80
  setData() {
70
81
  let nestedHeadersSettings = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
71
- _classPrivateFieldSet(_data, this, normalizeSettings(nestedHeadersSettings, _classPrivateFieldGet(_columnsLimit, this)));
72
- _classPrivateFieldSet(_dataLength, this, _classPrivateFieldGet(_data, this).length);
82
+ _classPrivateFieldSet(this, _data, normalizeSettings(nestedHeadersSettings, _classPrivateFieldGet(this, _columnsLimit)));
83
+ _classPrivateFieldSet(this, _dataLength, _classPrivateFieldGet(this, _data).length);
73
84
  }
74
85
 
75
86
  /**
@@ -78,7 +89,7 @@ export default class SourceSettings {
78
89
  * @returns {Array[]}
79
90
  */
80
91
  getData() {
81
- return _classPrivateFieldGet(_data, this);
92
+ return _classPrivateFieldGet(this, _data);
82
93
  }
83
94
 
84
95
  /**
@@ -110,7 +121,7 @@ export default class SourceSettings {
110
121
  * header settings.
111
122
  */
112
123
  map(callback) {
113
- arrayEach(_classPrivateFieldGet(_data, this), header => {
124
+ arrayEach(_classPrivateFieldGet(this, _data), header => {
114
125
  arrayEach(header, headerSettings => {
115
126
  const propsToExtend = callback({
116
127
  ...headerSettings
@@ -133,10 +144,10 @@ export default class SourceSettings {
133
144
  */
134
145
  getHeaderSettings(headerLevel, columnIndex) {
135
146
  var _headersSettings$colu;
136
- if (headerLevel >= _classPrivateFieldGet(_dataLength, this) || headerLevel < 0) {
147
+ if (headerLevel >= _classPrivateFieldGet(this, _dataLength) || headerLevel < 0) {
137
148
  return null;
138
149
  }
139
- const headersSettings = _classPrivateFieldGet(_data, this)[headerLevel];
150
+ const headersSettings = _classPrivateFieldGet(this, _data)[headerLevel];
140
151
  if (Array.isArray(headersSettings) === false || columnIndex >= headersSettings.length) {
141
152
  return null;
142
153
  }
@@ -156,10 +167,10 @@ export default class SourceSettings {
156
167
  getHeadersSettings(headerLevel, columnIndex) {
157
168
  let columnsLength = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
158
169
  const headersSettingsChunks = [];
159
- if (headerLevel >= _classPrivateFieldGet(_dataLength, this) || headerLevel < 0) {
170
+ if (headerLevel >= _classPrivateFieldGet(this, _dataLength) || headerLevel < 0) {
160
171
  return headersSettingsChunks;
161
172
  }
162
- const headersSettings = _classPrivateFieldGet(_data, this)[headerLevel];
173
+ const headersSettings = _classPrivateFieldGet(this, _data)[headerLevel];
163
174
  let currentLength = 0;
164
175
  for (let i = columnIndex; i < headersSettings.length; i++) {
165
176
  const headerSettings = headersSettings[i];
@@ -190,7 +201,7 @@ export default class SourceSettings {
190
201
  * @returns {number}
191
202
  */
192
203
  getLayersCount() {
193
- return _classPrivateFieldGet(_dataLength, this);
204
+ return _classPrivateFieldGet(this, _dataLength);
194
205
  }
195
206
 
196
207
  /**
@@ -199,14 +210,14 @@ export default class SourceSettings {
199
210
  * @returns {number}
200
211
  */
201
212
  getColumnsCount() {
202
- return _classPrivateFieldGet(_dataLength, this) > 0 ? _classPrivateFieldGet(_data, this)[0].length : 0;
213
+ return _classPrivateFieldGet(this, _dataLength) > 0 ? _classPrivateFieldGet(this, _data)[0].length : 0;
203
214
  }
204
215
 
205
216
  /**
206
217
  * Clears the data.
207
218
  */
208
219
  clear() {
209
- _classPrivateFieldSet(_data, this, []);
210
- _classPrivateFieldSet(_dataLength, this, 0);
220
+ _classPrivateFieldSet(this, _data, []);
221
+ _classPrivateFieldSet(this, _dataLength, 0);
211
222
  }
212
223
  }
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
 
3
3
  exports.__esModule = true;
4
- require("core-js/modules/es.error.cause.js");
5
4
  require("core-js/modules/es.array.push.js");
5
+ require("core-js/modules/es.error.cause.js");
6
6
  var _number = require("../../../helpers/number");
7
7
  var _object = require("../../../helpers/object");
8
8
  var _array = require("../../../helpers/array");
@@ -1,5 +1,5 @@
1
- import "core-js/modules/es.error.cause.js";
2
1
  import "core-js/modules/es.array.push.js";
2
+ import "core-js/modules/es.error.cause.js";
3
3
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4
4
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
5
5
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }