@deephaven/golden-layout 0.43.0 → 0.44.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/css/goldenlayout-base.css +1 -1
  2. package/css/goldenlayout-base.css.map +1 -1
  3. package/css/goldenlayout-dark-theme.css +1 -1
  4. package/css/goldenlayout-dark-theme.css.map +1 -1
  5. package/dist/GoldenLayout.module.css +1 -0
  6. package/dist/GoldenLayout.module.css.map +1 -0
  7. package/dist/GoldenLayoutThemeExport.js +6 -0
  8. package/dist/GoldenLayoutThemeExport.js.map +1 -0
  9. package/dist/LayoutManager.js +1001 -0
  10. package/dist/LayoutManager.js.map +1 -0
  11. package/dist/base.js +16 -0
  12. package/dist/base.js.map +1 -0
  13. package/dist/config/Config.js +42 -0
  14. package/dist/config/Config.js.map +1 -0
  15. package/dist/config/ItemConfig.js +14 -0
  16. package/dist/config/ItemConfig.js.map +1 -0
  17. package/dist/config/index.js +3 -0
  18. package/dist/config/index.js.map +1 -0
  19. package/dist/container/ItemContainer.js +199 -0
  20. package/dist/container/ItemContainer.js.map +1 -0
  21. package/dist/container/index.js +3 -0
  22. package/dist/container/index.js.map +1 -0
  23. package/dist/controls/BrowserPopout.js +250 -0
  24. package/dist/controls/BrowserPopout.js.map +1 -0
  25. package/dist/controls/DragProxy.js +204 -0
  26. package/dist/controls/DragProxy.js.map +1 -0
  27. package/dist/controls/DragSource.js +52 -0
  28. package/dist/controls/DragSource.js.map +1 -0
  29. package/dist/controls/DragSourceFromEvent.js +71 -0
  30. package/dist/controls/DragSourceFromEvent.js.map +1 -0
  31. package/dist/controls/DropTargetIndicator.js +27 -0
  32. package/dist/controls/DropTargetIndicator.js.map +1 -0
  33. package/dist/controls/Header.js +736 -0
  34. package/dist/controls/Header.js.map +1 -0
  35. package/dist/controls/HeaderButton.js +22 -0
  36. package/dist/controls/HeaderButton.js.map +1 -0
  37. package/dist/controls/Splitter.js +49 -0
  38. package/dist/controls/Splitter.js.map +1 -0
  39. package/dist/controls/Tab.js +225 -0
  40. package/dist/controls/Tab.js.map +1 -0
  41. package/dist/controls/index.js +10 -0
  42. package/dist/controls/index.js.map +1 -0
  43. package/dist/declaration.d.js +2 -0
  44. package/dist/declaration.d.js.map +1 -0
  45. package/dist/errors/ConfigurationError.js +14 -0
  46. package/dist/errors/ConfigurationError.js.map +1 -0
  47. package/dist/errors/index.js +2 -0
  48. package/dist/errors/index.js.map +1 -0
  49. package/dist/index.js +11 -0
  50. package/dist/index.js.map +1 -0
  51. package/dist/items/AbstractContentItem.js +565 -0
  52. package/dist/items/AbstractContentItem.js.map +1 -0
  53. package/dist/items/Component.js +80 -0
  54. package/dist/items/Component.js.map +1 -0
  55. package/dist/items/Root.js +100 -0
  56. package/dist/items/Root.js.map +1 -0
  57. package/dist/items/RowOrColumn.js +488 -0
  58. package/dist/items/RowOrColumn.js.map +1 -0
  59. package/dist/items/Stack.js +479 -0
  60. package/dist/items/Stack.js.map +1 -0
  61. package/dist/items/index.js +8 -0
  62. package/dist/items/index.js.map +1 -0
  63. package/dist/utils/BubblingEvent.js +17 -0
  64. package/dist/utils/BubblingEvent.js.map +1 -0
  65. package/dist/utils/ConfigMinifier.js +147 -0
  66. package/dist/utils/ConfigMinifier.js.map +1 -0
  67. package/dist/utils/DragListener.js +125 -0
  68. package/dist/utils/DragListener.js.map +1 -0
  69. package/dist/utils/EventEmitter.js +117 -0
  70. package/dist/utils/EventEmitter.js.map +1 -0
  71. package/dist/utils/EventHub.js +108 -0
  72. package/dist/utils/EventHub.js.map +1 -0
  73. package/dist/utils/ReactComponentHandler.js +136 -0
  74. package/dist/utils/ReactComponentHandler.js.map +1 -0
  75. package/dist/utils/index.js +8 -0
  76. package/dist/utils/index.js.map +1 -0
  77. package/dist/utils/utils.js +65 -0
  78. package/dist/utils/utils.js.map +1 -0
  79. package/package.json +3 -3
@@ -0,0 +1,488 @@
1
+ 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; }
2
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
3
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
4
+ import $ from 'jquery';
5
+ import AbstractContentItem from "./AbstractContentItem.js";
6
+ import { animFrame } from "../utils/index.js";
7
+ import { Splitter } from "../controls/index.js";
8
+ export default class RowOrColumn extends AbstractContentItem {
9
+ constructor(isColumn, layoutManager, config, parent) {
10
+ super(layoutManager, config, parent, $('<div class="lm_item lm_' + (isColumn ? 'column' : 'row') + '"></div>'));
11
+ _defineProperty(this, "isRow", void 0);
12
+ _defineProperty(this, "isColumn", void 0);
13
+ _defineProperty(this, "childElementContainer", void 0);
14
+ _defineProperty(this, "parent", void 0);
15
+ _defineProperty(this, "_splitter", []);
16
+ _defineProperty(this, "_splitterSize", void 0);
17
+ _defineProperty(this, "_splitterGrabSize", void 0);
18
+ _defineProperty(this, "_isColumn", void 0);
19
+ _defineProperty(this, "_dimension", void 0);
20
+ _defineProperty(this, "_splitterPosition", null);
21
+ _defineProperty(this, "_splitterMinPosition", null);
22
+ _defineProperty(this, "_splitterMaxPosition", null);
23
+ this.parent = parent;
24
+ this.isRow = !isColumn;
25
+ this.isColumn = isColumn;
26
+ this.childElementContainer = this.element;
27
+ this._splitterSize = layoutManager.config.dimensions.borderWidth;
28
+ this._splitterGrabSize = layoutManager.config.dimensions.borderGrabWidth;
29
+ this._isColumn = isColumn;
30
+ this._dimension = isColumn ? 'height' : 'width';
31
+ this._splitterPosition = null;
32
+ this._splitterMinPosition = null;
33
+ this._splitterMaxPosition = null;
34
+ }
35
+
36
+ /**
37
+ * Add a new contentItem to the Row or Column
38
+ *
39
+ * @param contentItem
40
+ * @param index The position of the new item within the Row or Column.
41
+ * If no index is provided the item will be added to the end
42
+ * @param _$suspendResize If true the items won't be resized. This will leave the item in
43
+ * an inconsistent state and is only intended to be used if multiple
44
+ * children need to be added in one go and resize is called afterwards
45
+ */
46
+ addChild(contentItem, index, _$suspendResize) {
47
+ var newItemSize, itemSize, i, splitterElement;
48
+ contentItem = this.layoutManager._$normalizeContentItem(contentItem, this);
49
+ if (index === undefined) {
50
+ index = this.contentItems.length;
51
+ }
52
+ if (this.contentItems.length > 0) {
53
+ splitterElement = this._createSplitter(Math.max(0, index - 1)).element;
54
+ if (index > 0) {
55
+ this.contentItems[index - 1].element.after(splitterElement);
56
+ splitterElement.after(contentItem.element);
57
+ } else {
58
+ this.contentItems[0].element.before(splitterElement);
59
+ splitterElement.before(contentItem.element);
60
+ }
61
+ } else {
62
+ this.childElementContainer.append(contentItem.element);
63
+ }
64
+ AbstractContentItem.prototype.addChild.call(this, contentItem, index);
65
+ newItemSize = 1 / this.contentItems.length * 100;
66
+ if (_$suspendResize === true) {
67
+ this.emitBubblingEvent('stateChanged');
68
+ return;
69
+ }
70
+ for (i = 0; i < this.contentItems.length; i++) {
71
+ if (this.contentItems[i] === contentItem) {
72
+ contentItem.config[this._dimension] = newItemSize;
73
+ } else {
74
+ var _this$contentItems$i$;
75
+ itemSize = ((_this$contentItems$i$ = this.contentItems[i].config[this._dimension]) !== null && _this$contentItems$i$ !== void 0 ? _this$contentItems$i$ : 0) * (100 - newItemSize) / 100;
76
+ this.contentItems[i].config[this._dimension] = itemSize;
77
+ }
78
+ }
79
+ this.callDownwards('setSize');
80
+ this.emitBubblingEvent('stateChanged');
81
+ }
82
+
83
+ /**
84
+ * Removes a child of this element
85
+ *
86
+ * @param contentItem
87
+ * @param keepChild If true the child will be removed, but not destroyed
88
+ */
89
+ removeChild(contentItem, keepChild) {
90
+ var _contentItem$config$t;
91
+ var removedItemSize = (_contentItem$config$t = contentItem.config[this._dimension]) !== null && _contentItem$config$t !== void 0 ? _contentItem$config$t : 0,
92
+ index = this.contentItems.indexOf(contentItem),
93
+ splitterIndex = Math.max(index - 1, 0),
94
+ i,
95
+ childItem;
96
+ if (index === -1) {
97
+ throw new Error("Can't remove child. ContentItem is not child of this Row or Column");
98
+ }
99
+
100
+ /**
101
+ * Remove the splitter before the item or after if the item happens
102
+ * to be the first in the row/column
103
+ */
104
+ if (this._splitter[splitterIndex]) {
105
+ this._splitter[splitterIndex]._$destroy();
106
+ this._splitter.splice(splitterIndex, 1);
107
+ }
108
+
109
+ /**
110
+ * Allocate the space that the removed item occupied to the remaining items
111
+ */
112
+ for (i = 0; i < this.contentItems.length; i++) {
113
+ if (this.contentItems[i] !== contentItem) {
114
+ var _this$contentItems$i$2;
115
+ this.contentItems[i].config[this._dimension] = ((_this$contentItems$i$2 = this.contentItems[i].config[this._dimension]) !== null && _this$contentItems$i$2 !== void 0 ? _this$contentItems$i$2 : 0) + removedItemSize / (this.contentItems.length - 1);
116
+ }
117
+ }
118
+ AbstractContentItem.prototype.removeChild.call(this, contentItem, keepChild);
119
+ if (this.contentItems.length === 1 && this.config.isClosable === true) {
120
+ childItem = this.contentItems[0];
121
+ this.contentItems = [];
122
+ this.parent.replaceChild(this, childItem, true);
123
+ } else {
124
+ this.callDownwards('setSize');
125
+ this.emitBubblingEvent('stateChanged');
126
+ }
127
+ }
128
+
129
+ /**
130
+ * Replaces a child of this Row or Column with another contentItem
131
+ *
132
+ * @param oldChild
133
+ * @param newChild
134
+ */
135
+ replaceChild(oldChild, newChild) {
136
+ var size = oldChild.config[this._dimension];
137
+ super.replaceChild(oldChild, newChild);
138
+ newChild.config[this._dimension] = size;
139
+ this.callDownwards('setSize');
140
+ this.emitBubblingEvent('stateChanged');
141
+ }
142
+
143
+ /**
144
+ * Called whenever the dimensions of this item or one of its parents change
145
+ */
146
+ setSize() {
147
+ if (this.contentItems.length > 0) {
148
+ this._calculateRelativeSizes();
149
+ this._setAbsoluteSizes();
150
+ }
151
+ this.emitBubblingEvent('stateChanged');
152
+ this.emit('resize');
153
+ }
154
+
155
+ /**
156
+ * Invoked recursively by the layout manager. AbstractContentItem.init appends
157
+ * the contentItem's DOM elements to the container, RowOrColumn init adds splitters
158
+ * in between them
159
+ */
160
+ _$init() {
161
+ if (this.isInitialised === true) return;
162
+ var i;
163
+ AbstractContentItem.prototype._$init.call(this);
164
+ for (i = 0; i < this.contentItems.length - 1; i++) {
165
+ this.contentItems[i].element.after(this._createSplitter(i).element);
166
+ }
167
+ }
168
+
169
+ /**
170
+ * Turns the relative sizes calculated by _calculateRelativeSizes into
171
+ * absolute pixel values and applies them to the children's DOM elements
172
+ *
173
+ * Assigns additional pixels to counteract Math.floor
174
+ */
175
+ _setAbsoluteSizes() {
176
+ var i,
177
+ sizeData = this._calculateAbsoluteSizes();
178
+ for (i = 0; i < this.contentItems.length; i++) {
179
+ if (sizeData.additionalPixel - i > 0) {
180
+ sizeData.itemSizes[i]++;
181
+ }
182
+ if (this._isColumn) {
183
+ this.contentItems[i].element.width(sizeData.totalWidth);
184
+ this.contentItems[i].element.height(sizeData.itemSizes[i]);
185
+ } else {
186
+ this.contentItems[i].element.width(sizeData.itemSizes[i]);
187
+ this.contentItems[i].element.height(sizeData.totalHeight);
188
+ }
189
+ }
190
+ }
191
+
192
+ /**
193
+ * Calculates the absolute sizes of all of the children of this Item.
194
+ * @returns {object} - Set with absolute sizes and additional pixels.
195
+ */
196
+ _calculateAbsoluteSizes() {
197
+ var _this$element$width, _this$element$height;
198
+ var totalSplitterSize = (this.contentItems.length - 1) * this._splitterSize;
199
+ var totalWidth = (_this$element$width = this.element.width()) !== null && _this$element$width !== void 0 ? _this$element$width : 0;
200
+ var totalHeight = (_this$element$height = this.element.height()) !== null && _this$element$height !== void 0 ? _this$element$height : 0;
201
+ var totalAssigned = 0;
202
+ var itemSizes = [];
203
+ if (this._isColumn) {
204
+ totalHeight -= totalSplitterSize;
205
+ } else {
206
+ totalWidth -= totalSplitterSize;
207
+ }
208
+ for (var i = 0; i < this.contentItems.length; i++) {
209
+ var _this$contentItems$i$3, _this$contentItems$i$4;
210
+ var itemSize = this._isColumn ? Math.floor(totalHeight * (((_this$contentItems$i$3 = this.contentItems[i].config.height) !== null && _this$contentItems$i$3 !== void 0 ? _this$contentItems$i$3 : 0) / 100)) : Math.floor(totalWidth * (((_this$contentItems$i$4 = this.contentItems[i].config.width) !== null && _this$contentItems$i$4 !== void 0 ? _this$contentItems$i$4 : 0) / 100));
211
+ totalAssigned += itemSize;
212
+ itemSizes.push(itemSize);
213
+ }
214
+ var additionalPixel = Math.floor((this._isColumn ? totalHeight : totalWidth) - totalAssigned);
215
+ return {
216
+ itemSizes,
217
+ additionalPixel,
218
+ totalWidth,
219
+ totalHeight
220
+ };
221
+ }
222
+
223
+ /**
224
+ * Calculates the relative sizes of all children of this Item. The logic
225
+ * is as follows:
226
+ *
227
+ * - Add up the total size of all items that have a configured size
228
+ *
229
+ * - If the total == 100 (check for floating point errors)
230
+ * Excellent, job done
231
+ *
232
+ * - If the total is > 100,
233
+ * set the size of items without set dimensions to 1/3 and add this to the total
234
+ * set the size off all items so that the total is hundred relative to their original size
235
+ *
236
+ * - If the total is < 100
237
+ * If there are items without set dimensions, distribute the remainder to 100 evenly between them
238
+ * If there are no items without set dimensions, increase all items sizes relative to
239
+ * their original size so that they add up to 100
240
+ */
241
+ _calculateRelativeSizes() {
242
+ var total = 0;
243
+ var itemsWithoutSetDimension = [];
244
+ var dimension = this._isColumn ? 'height' : 'width';
245
+ for (var i = 0; i < this.contentItems.length; i++) {
246
+ if (this.contentItems[i].config[dimension] !== undefined) {
247
+ var _this$contentItems$i$5;
248
+ total += (_this$contentItems$i$5 = this.contentItems[i].config[dimension]) !== null && _this$contentItems$i$5 !== void 0 ? _this$contentItems$i$5 : 0;
249
+ } else {
250
+ itemsWithoutSetDimension.push(this.contentItems[i]);
251
+ }
252
+ }
253
+
254
+ /**
255
+ * Everything adds up to hundred, all good :-)
256
+ */
257
+ if (Math.round(total) === 100) {
258
+ this._respectMinItemWidth();
259
+ return;
260
+ }
261
+
262
+ /**
263
+ * Allocate the remaining size to the items without a set dimension
264
+ */
265
+ if (Math.round(total) < 100 && itemsWithoutSetDimension.length > 0) {
266
+ for (var _i = 0; _i < itemsWithoutSetDimension.length; _i++) {
267
+ itemsWithoutSetDimension[_i].config[dimension] = (100 - total) / itemsWithoutSetDimension.length;
268
+ }
269
+ this._respectMinItemWidth();
270
+ return;
271
+ }
272
+
273
+ /**
274
+ * If the total is > 100, but there are also items without a set dimension left, assing 50
275
+ * as their dimension and add it to the total
276
+ *
277
+ * This will be reset in the next step
278
+ */
279
+ if (Math.round(total) > 100) {
280
+ for (var _i2 = 0; _i2 < itemsWithoutSetDimension.length; _i2++) {
281
+ itemsWithoutSetDimension[_i2].config[dimension] = 50;
282
+ total += 50;
283
+ }
284
+ }
285
+
286
+ /**
287
+ * Set every items size relative to 100 relative to its size to total
288
+ */
289
+ for (var _i3 = 0; _i3 < this.contentItems.length; _i3++) {
290
+ var _this$contentItems$_i;
291
+ this.contentItems[_i3].config[dimension] = ((_this$contentItems$_i = this.contentItems[_i3].config[dimension]) !== null && _this$contentItems$_i !== void 0 ? _this$contentItems$_i : 0) / total * 100;
292
+ }
293
+ this._respectMinItemWidth();
294
+ }
295
+
296
+ /**
297
+ * Adjusts the column widths to respect the dimensions minItemWidth if set.
298
+ */
299
+ _respectMinItemWidth() {
300
+ var _this$layoutManager$c;
301
+ var minItemWidth = this.layoutManager.config.dimensions ? (_this$layoutManager$c = this.layoutManager.config.dimensions.minItemWidth) !== null && _this$layoutManager$c !== void 0 ? _this$layoutManager$c : 0 : 0;
302
+ var entriesOverMin = [];
303
+ var totalOverMin = 0;
304
+ var totalUnderMin = 0;
305
+ var remainingWidth = 0;
306
+ var allEntries = [];
307
+ var entry;
308
+ if (this._isColumn || !minItemWidth || this.contentItems.length <= 1) {
309
+ return;
310
+ }
311
+ var sizeData = this._calculateAbsoluteSizes();
312
+
313
+ /**
314
+ * Figure out how much we are under the min item size total and how much room we have to use.
315
+ */
316
+ for (var i = 0; i < this.contentItems.length; i++) {
317
+ var contentItem = this.contentItems[i];
318
+ var itemSize = sizeData.itemSizes[i];
319
+ if (itemSize < minItemWidth) {
320
+ totalUnderMin += minItemWidth - itemSize;
321
+ entry = {
322
+ width: minItemWidth
323
+ };
324
+ } else {
325
+ totalOverMin += itemSize - minItemWidth;
326
+ entry = {
327
+ width: itemSize
328
+ };
329
+ entriesOverMin.push(entry);
330
+ }
331
+ allEntries.push(entry);
332
+ }
333
+
334
+ /**
335
+ * If there is nothing under min, or there is not enough over to make up the difference, do nothing.
336
+ */
337
+ if (totalUnderMin === 0 || totalUnderMin > totalOverMin) {
338
+ return;
339
+ }
340
+
341
+ /**
342
+ * Evenly reduce all columns that are over the min item width to make up the difference.
343
+ */
344
+ var reducePercent = totalUnderMin / totalOverMin;
345
+ remainingWidth = totalUnderMin;
346
+ for (var _i4 = 0; _i4 < entriesOverMin.length; _i4++) {
347
+ entry = entriesOverMin[_i4];
348
+ var reducedWidth = Math.round((entry.width - minItemWidth) * reducePercent);
349
+ remainingWidth -= reducedWidth;
350
+ entry.width -= reducedWidth;
351
+ }
352
+
353
+ /**
354
+ * Take anything remaining from the last item.
355
+ */
356
+ if (remainingWidth !== 0) {
357
+ allEntries[allEntries.length - 1].width -= remainingWidth;
358
+ }
359
+
360
+ /**
361
+ * Set every items size relative to 100 relative to its size to total
362
+ */
363
+ for (var _i5 = 0; _i5 < this.contentItems.length; _i5++) {
364
+ this.contentItems[_i5].config.width = allEntries[_i5].width / sizeData.totalWidth * 100;
365
+ }
366
+ }
367
+
368
+ /**
369
+ * Instantiates a new lm.controls.Splitter, binds events to it and adds
370
+ * it to the array of splitters at the position specified as the index argument
371
+ *
372
+ * What it doesn't do though is append the splitter to the DOM
373
+ *
374
+ * @param index The position of the splitter
375
+ * @returns The created splitter
376
+ */
377
+ _createSplitter(index) {
378
+ var splitter;
379
+ splitter = new Splitter(this._isColumn, this._splitterSize, this._splitterGrabSize);
380
+ splitter.on('drag', this._onSplitterDrag.bind(this, splitter), this);
381
+ splitter.on('dragStop', this._onSplitterDragStop.bind(this, splitter), this);
382
+ splitter.on('dragStart', this._onSplitterDragStart.bind(this, splitter), this);
383
+ this._splitter.splice(index, 0, splitter);
384
+ return splitter;
385
+ }
386
+
387
+ /**
388
+ * Locates the instance of lm.controls.Splitter in the array of
389
+ * registered splitters and returns a map containing the contentItem
390
+ * before and after the splitters, both of which are affected if the
391
+ * splitter is moved
392
+ *
393
+ * @param splitter
394
+ *
395
+ * @returns A map of contentItems that the splitter affects
396
+ */
397
+ _getItemsForSplitter(splitter) {
398
+ var index = this._splitter.indexOf(splitter);
399
+ if (index < 0) {
400
+ throw new Error('Splitter not found in RowOrColumn');
401
+ }
402
+ return {
403
+ before: this.contentItems[index],
404
+ after: this.contentItems[index + 1]
405
+ };
406
+ }
407
+
408
+ /**
409
+ * Gets the minimum dimensions for the given item configuration array
410
+ * @param item
411
+ * @private
412
+ */
413
+ _getMinimumDimensions(arr) {
414
+ var minWidth = 0,
415
+ minHeight = 0;
416
+ for (var i = 0; i < arr.length; ++i) {
417
+ var _arr$i$minWidth, _arr$i$minHeight;
418
+ minWidth = Math.max((_arr$i$minWidth = arr[i].minWidth) !== null && _arr$i$minWidth !== void 0 ? _arr$i$minWidth : 0, minWidth);
419
+ minHeight = Math.max((_arr$i$minHeight = arr[i].minHeight) !== null && _arr$i$minHeight !== void 0 ? _arr$i$minHeight : 0, minHeight);
420
+ }
421
+ return {
422
+ horizontal: minWidth,
423
+ vertical: minHeight
424
+ };
425
+ }
426
+
427
+ /**
428
+ * Invoked when a splitter's dragListener fires dragStart. Calculates the splitters
429
+ * movement area once (so that it doesn't need calculating on every mousemove event)
430
+ *
431
+ * @param splitter
432
+ */
433
+ _onSplitterDragStart(splitter) {
434
+ var _items$before$config$, _items$after$config$c, _items$before$element, _items$after$element$;
435
+ var items = this._getItemsForSplitter(splitter);
436
+ var minSize = this.layoutManager.config.dimensions[this._isColumn ? 'minItemHeight' : 'minItemWidth'];
437
+ var beforeMinDim = this._getMinimumDimensions((_items$before$config$ = items.before.config.content) !== null && _items$before$config$ !== void 0 ? _items$before$config$ : []);
438
+ var beforeMinSize = this._isColumn ? beforeMinDim.vertical : beforeMinDim.horizontal;
439
+ var afterMinDim = this._getMinimumDimensions((_items$after$config$c = items.after.config.content) !== null && _items$after$config$c !== void 0 ? _items$after$config$c : []);
440
+ var afterMinSize = this._isColumn ? afterMinDim.vertical : afterMinDim.horizontal;
441
+ this._splitterPosition = 0;
442
+ this._splitterMinPosition = -1 * (((_items$before$element = items.before.element[this._dimension]()) !== null && _items$before$element !== void 0 ? _items$before$element : 0) - (beforeMinSize || minSize));
443
+ this._splitterMaxPosition = ((_items$after$element$ = items.after.element[this._dimension]()) !== null && _items$after$element$ !== void 0 ? _items$after$element$ : 0) - (afterMinSize || minSize);
444
+ }
445
+
446
+ /**
447
+ * Invoked when a splitter's DragListener fires drag. Updates the splitters DOM position,
448
+ * but not the sizes of the elements the splitter controls in order to minimize resize events
449
+ *
450
+ * @param splitter
451
+ * @param offsetX Relative pixel values to the splitters original position. Can be negative
452
+ * @param offsetY Relative pixel values to the splitters original position. Can be negative
453
+ */
454
+ _onSplitterDrag(splitter, offsetX, offsetY) {
455
+ var offset = this._isColumn ? offsetY : offsetX;
456
+ if (this._splitterMaxPosition == null || this._splitterMinPosition == null) {
457
+ return;
458
+ }
459
+ if (offset > this._splitterMinPosition && offset < this._splitterMaxPosition) {
460
+ this._splitterPosition = offset;
461
+ splitter.element.css(this._isColumn ? 'top' : 'left', offset);
462
+ }
463
+ }
464
+
465
+ /**
466
+ * Invoked when a splitter's DragListener fires dragStop. Resets the splitters DOM position,
467
+ * and applies the new sizes to the elements before and after the splitter and their children
468
+ * on the next animation frame
469
+ *
470
+ * @param {lm.controls.Splitter} splitter
471
+ */
472
+ _onSplitterDragStop(splitter) {
473
+ var _items$before$element2, _items$after$element$2, _this$_splitterPositi, _items$before$config$2, _items$after$config$t;
474
+ var items = this._getItemsForSplitter(splitter);
475
+ var sizeBefore = (_items$before$element2 = items.before.element[this._dimension]()) !== null && _items$before$element2 !== void 0 ? _items$before$element2 : 0;
476
+ var sizeAfter = (_items$after$element$2 = items.after.element[this._dimension]()) !== null && _items$after$element$2 !== void 0 ? _items$after$element$2 : 0;
477
+ var splitterPositionInRange = (((_this$_splitterPositi = this._splitterPosition) !== null && _this$_splitterPositi !== void 0 ? _this$_splitterPositi : 0) + sizeBefore) / (sizeBefore + sizeAfter);
478
+ var totalRelativeSize = ((_items$before$config$2 = items.before.config[this._dimension]) !== null && _items$before$config$2 !== void 0 ? _items$before$config$2 : 0) + ((_items$after$config$t = items.after.config[this._dimension]) !== null && _items$after$config$t !== void 0 ? _items$after$config$t : 0);
479
+ items.before.config[this._dimension] = splitterPositionInRange * totalRelativeSize;
480
+ items.after.config[this._dimension] = (1 - splitterPositionInRange) * totalRelativeSize;
481
+ splitter.element.css({
482
+ top: 0,
483
+ left: 0
484
+ });
485
+ animFrame(this.callDownwards.bind(this, 'setSize', undefined, undefined, undefined));
486
+ }
487
+ }
488
+ //# sourceMappingURL=RowOrColumn.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RowOrColumn.js","names":["$","AbstractContentItem","animFrame","Splitter","RowOrColumn","constructor","isColumn","layoutManager","config","parent","isRow","childElementContainer","element","_splitterSize","dimensions","borderWidth","_splitterGrabSize","borderGrabWidth","_isColumn","_dimension","_splitterPosition","_splitterMinPosition","_splitterMaxPosition","addChild","contentItem","index","_$suspendResize","newItemSize","itemSize","i","splitterElement","_$normalizeContentItem","undefined","contentItems","length","_createSplitter","Math","max","after","before","append","prototype","call","emitBubblingEvent","callDownwards","removeChild","keepChild","removedItemSize","indexOf","splitterIndex","childItem","Error","_splitter","_$destroy","splice","isClosable","replaceChild","oldChild","newChild","size","setSize","_calculateRelativeSizes","_setAbsoluteSizes","emit","_$init","isInitialised","sizeData","_calculateAbsoluteSizes","additionalPixel","itemSizes","width","totalWidth","height","totalHeight","totalSplitterSize","totalAssigned","floor","push","total","itemsWithoutSetDimension","dimension","round","_respectMinItemWidth","minItemWidth","entriesOverMin","totalOverMin","totalUnderMin","remainingWidth","allEntries","entry","reducePercent","reducedWidth","splitter","on","_onSplitterDrag","bind","_onSplitterDragStop","_onSplitterDragStart","_getItemsForSplitter","_getMinimumDimensions","arr","minWidth","minHeight","horizontal","vertical","items","minSize","beforeMinDim","content","beforeMinSize","afterMinDim","afterMinSize","offsetX","offsetY","offset","css","sizeBefore","sizeAfter","splitterPositionInRange","totalRelativeSize","top","left"],"sources":["../../src/items/RowOrColumn.ts"],"sourcesContent":["import $ from 'jquery';\nimport AbstractContentItem from './AbstractContentItem';\nimport { animFrame } from '../utils';\nimport { Splitter } from '../controls';\nimport type LayoutManager from '../LayoutManager';\nimport type { ItemConfig, ItemConfigType } from '../config';\n\nexport default class RowOrColumn extends AbstractContentItem {\n isRow: boolean;\n isColumn: boolean;\n childElementContainer: JQuery<HTMLElement>;\n parent: AbstractContentItem;\n\n private _splitter: Splitter[] = [];\n private _splitterSize: number;\n private _splitterGrabSize: number;\n private _isColumn: boolean;\n private _dimension: 'height' | 'width';\n private _splitterPosition: number | null = null;\n private _splitterMinPosition: number | null = null;\n private _splitterMaxPosition: number | null = null;\n\n constructor(\n isColumn: boolean,\n layoutManager: LayoutManager,\n config: ItemConfigType,\n parent: AbstractContentItem\n ) {\n super(\n layoutManager,\n config,\n parent,\n $('<div class=\"lm_item lm_' + (isColumn ? 'column' : 'row') + '\"></div>')\n );\n this.parent = parent;\n\n this.isRow = !isColumn;\n this.isColumn = isColumn;\n\n this.childElementContainer = this.element;\n this._splitterSize = layoutManager.config.dimensions.borderWidth;\n this._splitterGrabSize = layoutManager.config.dimensions.borderGrabWidth;\n this._isColumn = isColumn;\n this._dimension = isColumn ? 'height' : 'width';\n this._splitterPosition = null;\n this._splitterMinPosition = null;\n this._splitterMaxPosition = null;\n }\n\n /**\n * Add a new contentItem to the Row or Column\n *\n * @param contentItem\n * @param index The position of the new item within the Row or Column.\n * If no index is provided the item will be added to the end\n * @param _$suspendResize If true the items won't be resized. This will leave the item in\n * an inconsistent state and is only intended to be used if multiple\n * children need to be added in one go and resize is called afterwards\n */\n addChild(\n contentItem: AbstractContentItem | { type: ItemConfig['type'] },\n index?: number,\n _$suspendResize?: boolean\n ) {\n var newItemSize, itemSize, i, splitterElement;\n\n contentItem = this.layoutManager._$normalizeContentItem(contentItem, this);\n\n if (index === undefined) {\n index = this.contentItems.length;\n }\n\n if (this.contentItems.length > 0) {\n splitterElement = this._createSplitter(Math.max(0, index - 1)).element;\n\n if (index > 0) {\n this.contentItems[index - 1].element.after(splitterElement);\n splitterElement.after(contentItem.element);\n } else {\n this.contentItems[0].element.before(splitterElement);\n splitterElement.before(contentItem.element);\n }\n } else {\n this.childElementContainer.append(contentItem.element);\n }\n\n AbstractContentItem.prototype.addChild.call(this, contentItem, index);\n\n newItemSize = (1 / this.contentItems.length) * 100;\n\n if (_$suspendResize === true) {\n this.emitBubblingEvent('stateChanged');\n return;\n }\n\n for (i = 0; i < this.contentItems.length; i++) {\n if (this.contentItems[i] === contentItem) {\n contentItem.config[this._dimension] = newItemSize;\n } else {\n itemSize =\n ((this.contentItems[i].config[this._dimension] ?? 0) *\n (100 - newItemSize)) /\n 100;\n this.contentItems[i].config[this._dimension] = itemSize;\n }\n }\n\n this.callDownwards('setSize');\n this.emitBubblingEvent('stateChanged');\n }\n\n /**\n * Removes a child of this element\n *\n * @param contentItem\n * @param keepChild If true the child will be removed, but not destroyed\n */\n removeChild(contentItem: AbstractContentItem, keepChild: boolean) {\n var removedItemSize = contentItem.config[this._dimension] ?? 0,\n index = this.contentItems.indexOf(contentItem),\n splitterIndex = Math.max(index - 1, 0),\n i,\n childItem;\n\n if (index === -1) {\n throw new Error(\n \"Can't remove child. ContentItem is not child of this Row or Column\"\n );\n }\n\n /**\n * Remove the splitter before the item or after if the item happens\n * to be the first in the row/column\n */\n if (this._splitter[splitterIndex]) {\n this._splitter[splitterIndex]._$destroy();\n this._splitter.splice(splitterIndex, 1);\n }\n\n /**\n * Allocate the space that the removed item occupied to the remaining items\n */\n for (i = 0; i < this.contentItems.length; i++) {\n if (this.contentItems[i] !== contentItem) {\n this.contentItems[i].config[this._dimension] =\n (this.contentItems[i].config[this._dimension] ?? 0) +\n removedItemSize / (this.contentItems.length - 1);\n }\n }\n\n AbstractContentItem.prototype.removeChild.call(\n this,\n contentItem,\n keepChild\n );\n\n if (this.contentItems.length === 1 && this.config.isClosable === true) {\n childItem = this.contentItems[0];\n this.contentItems = [];\n this.parent.replaceChild(this, childItem, true);\n } else {\n this.callDownwards('setSize');\n this.emitBubblingEvent('stateChanged');\n }\n }\n\n /**\n * Replaces a child of this Row or Column with another contentItem\n *\n * @param oldChild\n * @param newChild\n */\n replaceChild(oldChild: AbstractContentItem, newChild: AbstractContentItem) {\n var size = oldChild.config[this._dimension];\n super.replaceChild(oldChild, newChild);\n newChild.config[this._dimension] = size;\n this.callDownwards('setSize');\n this.emitBubblingEvent('stateChanged');\n }\n\n /**\n * Called whenever the dimensions of this item or one of its parents change\n */\n setSize() {\n if (this.contentItems.length > 0) {\n this._calculateRelativeSizes();\n this._setAbsoluteSizes();\n }\n this.emitBubblingEvent('stateChanged');\n this.emit('resize');\n }\n\n /**\n * Invoked recursively by the layout manager. AbstractContentItem.init appends\n * the contentItem's DOM elements to the container, RowOrColumn init adds splitters\n * in between them\n */\n _$init() {\n if (this.isInitialised === true) return;\n\n var i;\n\n AbstractContentItem.prototype._$init.call(this);\n\n for (i = 0; i < this.contentItems.length - 1; i++) {\n this.contentItems[i].element.after(this._createSplitter(i).element);\n }\n }\n\n /**\n * Turns the relative sizes calculated by _calculateRelativeSizes into\n * absolute pixel values and applies them to the children's DOM elements\n *\n * Assigns additional pixels to counteract Math.floor\n */\n _setAbsoluteSizes() {\n var i,\n sizeData = this._calculateAbsoluteSizes();\n\n for (i = 0; i < this.contentItems.length; i++) {\n if (sizeData.additionalPixel - i > 0) {\n sizeData.itemSizes[i]++;\n }\n\n if (this._isColumn) {\n this.contentItems[i].element.width(sizeData.totalWidth);\n this.contentItems[i].element.height(sizeData.itemSizes[i]);\n } else {\n this.contentItems[i].element.width(sizeData.itemSizes[i]);\n this.contentItems[i].element.height(sizeData.totalHeight);\n }\n }\n }\n\n /**\n * Calculates the absolute sizes of all of the children of this Item.\n * @returns {object} - Set with absolute sizes and additional pixels.\n */\n _calculateAbsoluteSizes() {\n const totalSplitterSize =\n (this.contentItems.length - 1) * this._splitterSize;\n let totalWidth = this.element.width() ?? 0;\n let totalHeight = this.element.height() ?? 0;\n let totalAssigned = 0;\n const itemSizes: number[] = [];\n\n if (this._isColumn) {\n totalHeight -= totalSplitterSize;\n } else {\n totalWidth -= totalSplitterSize;\n }\n\n for (let i = 0; i < this.contentItems.length; i++) {\n const itemSize = this._isColumn\n ? Math.floor(\n totalHeight * ((this.contentItems[i].config.height ?? 0) / 100)\n )\n : Math.floor(\n totalWidth * ((this.contentItems[i].config.width ?? 0) / 100)\n );\n\n totalAssigned += itemSize;\n itemSizes.push(itemSize);\n }\n\n const additionalPixel = Math.floor(\n (this._isColumn ? totalHeight : totalWidth) - totalAssigned\n );\n\n return {\n itemSizes,\n additionalPixel,\n totalWidth,\n totalHeight,\n };\n }\n\n /**\n * Calculates the relative sizes of all children of this Item. The logic\n * is as follows:\n *\n * - Add up the total size of all items that have a configured size\n *\n * - If the total == 100 (check for floating point errors)\n * Excellent, job done\n *\n * - If the total is > 100,\n * set the size of items without set dimensions to 1/3 and add this to the total\n * set the size off all items so that the total is hundred relative to their original size\n *\n * - If the total is < 100\n * If there are items without set dimensions, distribute the remainder to 100 evenly between them\n * If there are no items without set dimensions, increase all items sizes relative to\n * their original size so that they add up to 100\n */\n _calculateRelativeSizes() {\n let total = 0;\n const itemsWithoutSetDimension: AbstractContentItem[] = [];\n const dimension = this._isColumn ? 'height' : 'width';\n\n for (let i = 0; i < this.contentItems.length; i++) {\n if (this.contentItems[i].config[dimension] !== undefined) {\n total += this.contentItems[i].config[dimension] ?? 0;\n } else {\n itemsWithoutSetDimension.push(this.contentItems[i]);\n }\n }\n\n /**\n * Everything adds up to hundred, all good :-)\n */\n if (Math.round(total) === 100) {\n this._respectMinItemWidth();\n return;\n }\n\n /**\n * Allocate the remaining size to the items without a set dimension\n */\n if (Math.round(total) < 100 && itemsWithoutSetDimension.length > 0) {\n for (let i = 0; i < itemsWithoutSetDimension.length; i++) {\n itemsWithoutSetDimension[i].config[dimension] =\n (100 - total) / itemsWithoutSetDimension.length;\n }\n this._respectMinItemWidth();\n return;\n }\n\n /**\n * If the total is > 100, but there are also items without a set dimension left, assing 50\n * as their dimension and add it to the total\n *\n * This will be reset in the next step\n */\n if (Math.round(total) > 100) {\n for (let i = 0; i < itemsWithoutSetDimension.length; i++) {\n itemsWithoutSetDimension[i].config[dimension] = 50;\n total += 50;\n }\n }\n\n /**\n * Set every items size relative to 100 relative to its size to total\n */\n for (let i = 0; i < this.contentItems.length; i++) {\n this.contentItems[i].config[dimension] =\n ((this.contentItems[i].config[dimension] ?? 0) / total) * 100;\n }\n\n this._respectMinItemWidth();\n }\n\n /**\n * Adjusts the column widths to respect the dimensions minItemWidth if set.\n */\n _respectMinItemWidth() {\n const minItemWidth = this.layoutManager.config.dimensions\n ? this.layoutManager.config.dimensions.minItemWidth ?? 0\n : 0;\n const entriesOverMin = [];\n let totalOverMin = 0;\n let totalUnderMin = 0;\n let remainingWidth = 0;\n const allEntries = [];\n let entry;\n\n if (this._isColumn || !minItemWidth || this.contentItems.length <= 1) {\n return;\n }\n\n const sizeData = this._calculateAbsoluteSizes();\n\n /**\n * Figure out how much we are under the min item size total and how much room we have to use.\n */\n for (let i = 0; i < this.contentItems.length; i++) {\n const contentItem = this.contentItems[i];\n const itemSize = sizeData.itemSizes[i];\n\n if (itemSize < minItemWidth) {\n totalUnderMin += minItemWidth - itemSize;\n entry = { width: minItemWidth };\n } else {\n totalOverMin += itemSize - minItemWidth;\n entry = { width: itemSize };\n entriesOverMin.push(entry);\n }\n\n allEntries.push(entry);\n }\n\n /**\n * If there is nothing under min, or there is not enough over to make up the difference, do nothing.\n */\n if (totalUnderMin === 0 || totalUnderMin > totalOverMin) {\n return;\n }\n\n /**\n * Evenly reduce all columns that are over the min item width to make up the difference.\n */\n const reducePercent = totalUnderMin / totalOverMin;\n remainingWidth = totalUnderMin;\n for (let i = 0; i < entriesOverMin.length; i++) {\n entry = entriesOverMin[i];\n const reducedWidth = Math.round(\n (entry.width - minItemWidth) * reducePercent\n );\n remainingWidth -= reducedWidth;\n entry.width -= reducedWidth;\n }\n\n /**\n * Take anything remaining from the last item.\n */\n if (remainingWidth !== 0) {\n allEntries[allEntries.length - 1].width -= remainingWidth;\n }\n\n /**\n * Set every items size relative to 100 relative to its size to total\n */\n for (let i = 0; i < this.contentItems.length; i++) {\n this.contentItems[i].config.width =\n (allEntries[i].width / sizeData.totalWidth) * 100;\n }\n }\n\n /**\n * Instantiates a new lm.controls.Splitter, binds events to it and adds\n * it to the array of splitters at the position specified as the index argument\n *\n * What it doesn't do though is append the splitter to the DOM\n *\n * @param index The position of the splitter\n * @returns The created splitter\n */\n _createSplitter(index: number): Splitter {\n var splitter;\n splitter = new Splitter(\n this._isColumn,\n this._splitterSize,\n this._splitterGrabSize\n );\n splitter.on('drag', this._onSplitterDrag.bind(this, splitter), this);\n splitter.on(\n 'dragStop',\n this._onSplitterDragStop.bind(this, splitter),\n this\n );\n splitter.on(\n 'dragStart',\n this._onSplitterDragStart.bind(this, splitter),\n this\n );\n this._splitter.splice(index, 0, splitter);\n return splitter;\n }\n\n /**\n * Locates the instance of lm.controls.Splitter in the array of\n * registered splitters and returns a map containing the contentItem\n * before and after the splitters, both of which are affected if the\n * splitter is moved\n *\n * @param splitter\n *\n * @returns A map of contentItems that the splitter affects\n */\n _getItemsForSplitter(splitter: Splitter) {\n const index = this._splitter.indexOf(splitter);\n\n if (index < 0) {\n throw new Error('Splitter not found in RowOrColumn');\n }\n\n return {\n before: this.contentItems[index],\n after: this.contentItems[index + 1],\n };\n }\n\n /**\n * Gets the minimum dimensions for the given item configuration array\n * @param item\n * @private\n */\n _getMinimumDimensions(arr: { minWidth?: number; minHeight?: number }[]) {\n var minWidth = 0,\n minHeight = 0;\n\n for (var i = 0; i < arr.length; ++i) {\n minWidth = Math.max(arr[i].minWidth ?? 0, minWidth);\n minHeight = Math.max(arr[i].minHeight ?? 0, minHeight);\n }\n\n return { horizontal: minWidth, vertical: minHeight };\n }\n\n /**\n * Invoked when a splitter's dragListener fires dragStart. Calculates the splitters\n * movement area once (so that it doesn't need calculating on every mousemove event)\n *\n * @param splitter\n */\n _onSplitterDragStart(splitter: Splitter) {\n const items = this._getItemsForSplitter(splitter);\n const minSize = this.layoutManager.config.dimensions[\n this._isColumn ? 'minItemHeight' : 'minItemWidth'\n ];\n\n var beforeMinDim = this._getMinimumDimensions(\n items.before.config.content ?? []\n );\n var beforeMinSize = this._isColumn\n ? beforeMinDim.vertical\n : beforeMinDim.horizontal;\n\n var afterMinDim = this._getMinimumDimensions(\n items.after.config.content ?? []\n );\n var afterMinSize = this._isColumn\n ? afterMinDim.vertical\n : afterMinDim.horizontal;\n\n this._splitterPosition = 0;\n this._splitterMinPosition =\n -1 *\n ((items.before.element[this._dimension]() ?? 0) -\n (beforeMinSize || minSize));\n this._splitterMaxPosition =\n (items.after.element[this._dimension]() ?? 0) - (afterMinSize || minSize);\n }\n\n /**\n * Invoked when a splitter's DragListener fires drag. Updates the splitters DOM position,\n * but not the sizes of the elements the splitter controls in order to minimize resize events\n *\n * @param splitter\n * @param offsetX Relative pixel values to the splitters original position. Can be negative\n * @param offsetY Relative pixel values to the splitters original position. Can be negative\n */\n _onSplitterDrag(splitter: Splitter, offsetX: number, offsetY: number) {\n const offset = this._isColumn ? offsetY : offsetX;\n\n if (\n this._splitterMaxPosition == null ||\n this._splitterMinPosition == null\n ) {\n return;\n }\n\n if (\n offset > this._splitterMinPosition &&\n offset < this._splitterMaxPosition\n ) {\n this._splitterPosition = offset;\n splitter.element.css(this._isColumn ? 'top' : 'left', offset);\n }\n }\n\n /**\n * Invoked when a splitter's DragListener fires dragStop. Resets the splitters DOM position,\n * and applies the new sizes to the elements before and after the splitter and their children\n * on the next animation frame\n *\n * @param {lm.controls.Splitter} splitter\n */\n _onSplitterDragStop(splitter: Splitter) {\n const items = this._getItemsForSplitter(splitter);\n const sizeBefore = items.before.element[this._dimension]() ?? 0;\n const sizeAfter = items.after.element[this._dimension]() ?? 0;\n const splitterPositionInRange =\n ((this._splitterPosition ?? 0) + sizeBefore) / (sizeBefore + sizeAfter);\n const totalRelativeSize =\n (items.before.config[this._dimension] ?? 0) +\n (items.after.config[this._dimension] ?? 0);\n\n items.before.config[this._dimension] =\n splitterPositionInRange * totalRelativeSize;\n items.after.config[this._dimension] =\n (1 - splitterPositionInRange) * totalRelativeSize;\n\n splitter.element.css({\n top: 0,\n left: 0,\n });\n\n animFrame(\n this.callDownwards.bind(this, 'setSize', undefined, undefined, undefined)\n );\n }\n}\n"],"mappings":";;;AAAA,OAAOA,CAAC,MAAM,QAAQ;AAAC,OAChBC,mBAAmB;AAAA,SACjBC,SAAS;AAAA,SACTC,QAAQ;AAIjB,eAAe,MAAMC,WAAW,SAASH,mBAAmB,CAAC;EAe3DI,WAAW,CACTC,QAAiB,EACjBC,aAA4B,EAC5BC,MAAsB,EACtBC,MAA2B,EAC3B;IACA,KAAK,CACHF,aAAa,EACbC,MAAM,EACNC,MAAM,EACNT,CAAC,CAAC,yBAAyB,IAAIM,QAAQ,GAAG,QAAQ,GAAG,KAAK,CAAC,GAAG,UAAU,CAAC,CAC1E;IAAC;IAAA;IAAA;IAAA;IAAA,mCApB4B,EAAE;IAAA;IAAA;IAAA;IAAA;IAAA,2CAKS,IAAI;IAAA,8CACD,IAAI;IAAA,8CACJ,IAAI;IAchD,IAAI,CAACG,MAAM,GAAGA,MAAM;IAEpB,IAAI,CAACC,KAAK,GAAG,CAACJ,QAAQ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