irie 0.0.9__py3-none-any.whl → 0.0.10__py3-none-any.whl

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 (122) hide show
  1. irie/apps/static/assets/vendor/@popperjs/core/dist/cjs/popper-base.js +1069 -0
  2. irie/apps/static/assets/vendor/@popperjs/core/dist/cjs/popper-base.js.flow +3 -0
  3. irie/apps/static/assets/vendor/@popperjs/core/dist/cjs/popper-lite.js +1378 -0
  4. irie/apps/static/assets/vendor/@popperjs/core/dist/cjs/popper-lite.js.flow +3 -0
  5. irie/apps/static/assets/vendor/@popperjs/core/dist/cjs/popper.js +1927 -0
  6. irie/apps/static/assets/vendor/@popperjs/core/dist/cjs/popper.js.flow +3 -0
  7. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/createPopper.js +258 -0
  8. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/dom-utils/contains.js +23 -0
  9. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/dom-utils/getBoundingClientRect.js +28 -0
  10. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/dom-utils/getClippingRect.js +70 -0
  11. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/dom-utils/getCompositeRect.js +57 -0
  12. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/dom-utils/getComputedStyle.js +4 -0
  13. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/dom-utils/getDocumentElement.js +6 -0
  14. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/dom-utils/getDocumentRect.js +29 -0
  15. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/dom-utils/getHTMLElementScroll.js +6 -0
  16. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/dom-utils/getLayoutRect.js +25 -0
  17. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/dom-utils/getNodeName.js +3 -0
  18. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/dom-utils/getNodeScroll.js +11 -0
  19. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/dom-utils/getOffsetParent.js +64 -0
  20. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/dom-utils/getParentNode.js +19 -0
  21. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/dom-utils/getScrollParent.js +16 -0
  22. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/dom-utils/getViewportRect.js +40 -0
  23. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/dom-utils/getWindow.js +12 -0
  24. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/dom-utils/getWindowScroll.js +10 -0
  25. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/dom-utils/getWindowScrollBarX.js +13 -0
  26. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/dom-utils/instanceOf.js +23 -0
  27. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/dom-utils/isScrollParent.js +10 -0
  28. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/dom-utils/isTableElement.js +4 -0
  29. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/dom-utils/listScrollParents.js +26 -0
  30. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/enums.js +31 -0
  31. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/index.js +8 -0
  32. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/modifiers/applyStyles.js +84 -0
  33. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/modifiers/arrow.js +101 -0
  34. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/modifiers/computeStyles.js +155 -0
  35. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/modifiers/eventListeners.js +49 -0
  36. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/modifiers/flip.js +147 -0
  37. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/modifiers/hide.js +61 -0
  38. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/modifiers/index.js +9 -0
  39. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/modifiers/offset.js +53 -0
  40. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/modifiers/popperOffsets.js +25 -0
  41. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/modifiers/preventOverflow.js +123 -0
  42. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/popper-base.js +3 -0
  43. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/popper-lite.js +11 -0
  44. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/popper.js +20 -0
  45. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/types.js +0 -0
  46. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/utils/computeAutoPlacement.js +47 -0
  47. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/utils/computeOffsets.js +70 -0
  48. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/utils/debounce.js +15 -0
  49. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/utils/detectOverflow.js +64 -0
  50. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/utils/expandToHashMap.js +6 -0
  51. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/utils/format.js +9 -0
  52. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/utils/getAltAxis.js +3 -0
  53. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/utils/getAltLen.js +3 -0
  54. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/utils/getBasePlacement.js +4 -0
  55. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/utils/getFreshSideObject.js +8 -0
  56. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/utils/getMainAxisFromPlacement.js +3 -0
  57. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/utils/getOppositePlacement.js +11 -0
  58. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/utils/getOppositeVariationPlacement.js +9 -0
  59. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/utils/getVariation.js +3 -0
  60. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/utils/math.js +3 -0
  61. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/utils/mergeByName.js +14 -0
  62. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/utils/mergePaddingObject.js +4 -0
  63. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/utils/orderModifiers.js +44 -0
  64. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/utils/rectToClientRect.js +8 -0
  65. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/utils/uniqueBy.js +11 -0
  66. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/utils/validateModifiers.js +76 -0
  67. irie/apps/static/assets/vendor/@popperjs/core/dist/esm/utils/within.js +4 -0
  68. irie/apps/static/assets/vendor/@popperjs/core/dist/umd/popper-base.min.js +6 -0
  69. irie/apps/static/assets/vendor/@popperjs/core/dist/umd/popper-base.min.js.flow +3 -0
  70. irie/apps/static/assets/vendor/@popperjs/core/dist/umd/popper-lite.min.js +6 -0
  71. irie/apps/static/assets/vendor/@popperjs/core/dist/umd/popper-lite.min.js.flow +3 -0
  72. irie/apps/static/assets/vendor/@popperjs/core/dist/umd/popper.min.js +6 -0
  73. irie/apps/static/assets/vendor/@popperjs/core/dist/umd/popper.min.js.flow +3 -0
  74. irie/apps/static/assets/vendor/bootstrap/dist/css/bootstrap-grid.min.css +6 -0
  75. irie/apps/static/assets/vendor/bootstrap/dist/css/bootstrap-grid.rtl.min.css +6 -0
  76. irie/apps/static/assets/vendor/bootstrap/dist/css/bootstrap-reboot.min.css +7 -0
  77. irie/apps/static/assets/vendor/bootstrap/dist/css/bootstrap-reboot.rtl.min.css +7 -0
  78. irie/apps/static/assets/vendor/bootstrap/dist/css/bootstrap-utilities.min.css +6 -0
  79. irie/apps/static/assets/vendor/bootstrap/dist/css/bootstrap-utilities.rtl.min.css +6 -0
  80. irie/apps/static/assets/vendor/bootstrap/dist/css/bootstrap.min.css +6 -0
  81. irie/apps/static/assets/vendor/bootstrap/dist/css/bootstrap.rtl.min.css +6 -0
  82. irie/apps/static/assets/vendor/bootstrap/dist/js/bootstrap.bundle.min.js +6 -0
  83. irie/apps/static/assets/vendor/bootstrap/dist/js/bootstrap.esm.min.js +6 -0
  84. irie/apps/static/assets/vendor/bootstrap/dist/js/bootstrap.min.js +6 -0
  85. irie/apps/static/assets/vendor/chartist-plugin-tooltips/dist/chartist-plugin-tooltip.css +34 -0
  86. irie/apps/static/assets/vendor/chartist-plugin-tooltips/dist/chartist-plugin-tooltip.min.js +7 -0
  87. irie/apps/static/assets/vendor/notyf/notyf.es.js +441 -0
  88. irie/apps/static/assets/vendor/notyf/notyf.min.css +1 -0
  89. irie/apps/static/assets/vendor/notyf/notyf.min.js +1 -0
  90. irie/apps/static/assets/vendor/notyf/notyf.umd.js +449 -0
  91. irie/apps/static/assets/vendor/nouislider/distribute/nouislider.min.css +1 -0
  92. irie/apps/static/assets/vendor/nouislider/distribute/nouislider.min.js +1 -0
  93. irie/apps/static/assets/vendor/nouislider/distribute/nouislider.min.mjs +1 -0
  94. irie/apps/static/assets/vendor/nouislider/distribute/nouislider.mjs +2238 -0
  95. irie/apps/static/assets/vendor/onscreen/dist/index.js +21 -0
  96. irie/apps/static/assets/vendor/onscreen/dist/on-screen.es6.js +404 -0
  97. irie/apps/static/assets/vendor/onscreen/dist/on-screen.umd.min.js +1 -0
  98. irie/apps/static/assets/vendor/simplebar/dist/simplebar-core.esm.js +889 -0
  99. irie/apps/static/assets/vendor/simplebar/dist/simplebar.esm.js +994 -0
  100. irie/apps/static/assets/vendor/simplebar/dist/simplebar.min.css +1 -0
  101. irie/apps/static/assets/vendor/simplebar/dist/simplebar.min.js +10 -0
  102. irie/apps/static/assets/vendor/simplebar/dist/simplebar.umd.js +127 -0
  103. irie/apps/static/assets/vendor/smooth-scroll/dist/smooth-scroll.min.js +2 -0
  104. irie/apps/static/assets/vendor/smooth-scroll/dist/smooth-scroll.polyfills.min.js +2 -0
  105. irie/apps/static/assets/vendor/sweetalert2/dist/sweetalert2.all.min.js +2 -0
  106. irie/apps/static/assets/vendor/sweetalert2/dist/sweetalert2.min.css +1 -0
  107. irie/apps/static/assets/vendor/sweetalert2/dist/sweetalert2.min.js +1 -0
  108. irie/apps/static/assets/vendor/waypoints/lib/jquery.waypoints.min.js +7 -0
  109. irie/apps/static/assets/vendor/waypoints/lib/noframework.waypoints.min.js +7 -0
  110. irie/apps/static/assets/vendor/waypoints/lib/shortcuts/infinite.min.js +7 -0
  111. irie/apps/static/assets/vendor/waypoints/lib/shortcuts/inview.min.js +7 -0
  112. irie/apps/static/assets/vendor/waypoints/lib/shortcuts/sticky.min.js +7 -0
  113. irie/apps/static/assets/vendor/waypoints/lib/waypoints.debug.js +46 -0
  114. irie/apps/static/assets/vendor/waypoints/lib/zepto.waypoints.min.js +7 -0
  115. irie/apps/static/assets/vendor/waypoints/licenses.txt +23 -0
  116. irie/apps/static/assets/vendor/waypoints/testem.json +24 -0
  117. irie/init/hayward.zip +0 -0
  118. {irie-0.0.9.dist-info → irie-0.0.10.dist-info}/METADATA +1 -1
  119. {irie-0.0.9.dist-info → irie-0.0.10.dist-info}/RECORD +122 -5
  120. {irie-0.0.9.dist-info → irie-0.0.10.dist-info}/WHEEL +0 -0
  121. {irie-0.0.9.dist-info → irie-0.0.10.dist-info}/entry_points.txt +0 -0
  122. {irie-0.0.9.dist-info → irie-0.0.10.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,994 @@
1
+ /**
2
+ * SimpleBar.js - v5.3.5
3
+ * Scrollbars, simpler.
4
+ * https://grsmto.github.io/simplebar/
5
+ *
6
+ * Made by Adrien Denat from a fork by Jonathan Nicol
7
+ * Under MIT License
8
+ */
9
+
10
+ import 'core-js/modules/es.array.for-each';
11
+ import 'core-js/modules/web.dom-collections.for-each';
12
+ import canUseDOM from 'can-use-dom';
13
+ import 'core-js/modules/es.array.filter';
14
+ import 'core-js/modules/es.array.iterator';
15
+ import 'core-js/modules/es.object.assign';
16
+ import 'core-js/modules/es.object.to-string';
17
+ import 'core-js/modules/es.parse-int';
18
+ import 'core-js/modules/es.string.iterator';
19
+ import 'core-js/modules/es.weak-map';
20
+ import 'core-js/modules/web.dom-collections.iterator';
21
+ import throttle from 'lodash.throttle';
22
+ import debounce from 'lodash.debounce';
23
+ import memoize from 'lodash.memoize';
24
+ import { ResizeObserver } from '@juggle/resize-observer';
25
+ import 'core-js/modules/es.array.reduce';
26
+ import 'core-js/modules/es.function.name';
27
+ import 'core-js/modules/es.regexp.exec';
28
+ import 'core-js/modules/es.string.match';
29
+ import 'core-js/modules/es.string.replace';
30
+
31
+ // Helper function to retrieve options from element attributes
32
+ var getOptions = function getOptions(obj) {
33
+ var options = Array.prototype.reduce.call(obj, function (acc, attribute) {
34
+ var option = attribute.name.match(/data-simplebar-(.+)/);
35
+
36
+ if (option) {
37
+ var key = option[1].replace(/\W+(.)/g, function (x, chr) {
38
+ return chr.toUpperCase();
39
+ });
40
+
41
+ switch (attribute.value) {
42
+ case 'true':
43
+ acc[key] = true;
44
+ break;
45
+
46
+ case 'false':
47
+ acc[key] = false;
48
+ break;
49
+
50
+ case undefined:
51
+ acc[key] = true;
52
+ break;
53
+
54
+ default:
55
+ acc[key] = attribute.value;
56
+ }
57
+ }
58
+
59
+ return acc;
60
+ }, {});
61
+ return options;
62
+ };
63
+ function getElementWindow(element) {
64
+ if (!element || !element.ownerDocument || !element.ownerDocument.defaultView) {
65
+ return window;
66
+ }
67
+
68
+ return element.ownerDocument.defaultView;
69
+ }
70
+ function getElementDocument(element) {
71
+ if (!element || !element.ownerDocument) {
72
+ return document;
73
+ }
74
+
75
+ return element.ownerDocument;
76
+ }
77
+
78
+ var cachedScrollbarWidth = null;
79
+ var cachedDevicePixelRatio = null;
80
+
81
+ if (canUseDOM) {
82
+ window.addEventListener('resize', function () {
83
+ if (cachedDevicePixelRatio !== window.devicePixelRatio) {
84
+ cachedDevicePixelRatio = window.devicePixelRatio;
85
+ cachedScrollbarWidth = null;
86
+ }
87
+ });
88
+ }
89
+
90
+ function scrollbarWidth(el) {
91
+ if (cachedScrollbarWidth === null) {
92
+ var document = getElementDocument(el);
93
+
94
+ if (typeof document === 'undefined') {
95
+ cachedScrollbarWidth = 0;
96
+ return cachedScrollbarWidth;
97
+ }
98
+
99
+ var body = document.body;
100
+ var box = document.createElement('div');
101
+ box.classList.add('simplebar-hide-scrollbar');
102
+ body.appendChild(box);
103
+ var width = box.getBoundingClientRect().right;
104
+ body.removeChild(box);
105
+ cachedScrollbarWidth = width;
106
+ }
107
+
108
+ return cachedScrollbarWidth;
109
+ }
110
+
111
+ var SimpleBar =
112
+ /*#__PURE__*/
113
+ function () {
114
+ function SimpleBar(element, options) {
115
+ var _this = this;
116
+
117
+ this.onScroll = function () {
118
+ var elWindow = getElementWindow(_this.el);
119
+
120
+ if (!_this.scrollXTicking) {
121
+ elWindow.requestAnimationFrame(_this.scrollX);
122
+ _this.scrollXTicking = true;
123
+ }
124
+
125
+ if (!_this.scrollYTicking) {
126
+ elWindow.requestAnimationFrame(_this.scrollY);
127
+ _this.scrollYTicking = true;
128
+ }
129
+ };
130
+
131
+ this.scrollX = function () {
132
+ if (_this.axis.x.isOverflowing) {
133
+ _this.showScrollbar('x');
134
+
135
+ _this.positionScrollbar('x');
136
+ }
137
+
138
+ _this.scrollXTicking = false;
139
+ };
140
+
141
+ this.scrollY = function () {
142
+ if (_this.axis.y.isOverflowing) {
143
+ _this.showScrollbar('y');
144
+
145
+ _this.positionScrollbar('y');
146
+ }
147
+
148
+ _this.scrollYTicking = false;
149
+ };
150
+
151
+ this.onMouseEnter = function () {
152
+ _this.showScrollbar('x');
153
+
154
+ _this.showScrollbar('y');
155
+ };
156
+
157
+ this.onMouseMove = function (e) {
158
+ _this.mouseX = e.clientX;
159
+ _this.mouseY = e.clientY;
160
+
161
+ if (_this.axis.x.isOverflowing || _this.axis.x.forceVisible) {
162
+ _this.onMouseMoveForAxis('x');
163
+ }
164
+
165
+ if (_this.axis.y.isOverflowing || _this.axis.y.forceVisible) {
166
+ _this.onMouseMoveForAxis('y');
167
+ }
168
+ };
169
+
170
+ this.onMouseLeave = function () {
171
+ _this.onMouseMove.cancel();
172
+
173
+ if (_this.axis.x.isOverflowing || _this.axis.x.forceVisible) {
174
+ _this.onMouseLeaveForAxis('x');
175
+ }
176
+
177
+ if (_this.axis.y.isOverflowing || _this.axis.y.forceVisible) {
178
+ _this.onMouseLeaveForAxis('y');
179
+ }
180
+
181
+ _this.mouseX = -1;
182
+ _this.mouseY = -1;
183
+ };
184
+
185
+ this.onWindowResize = function () {
186
+ // Recalculate scrollbarWidth in case it's a zoom
187
+ _this.scrollbarWidth = _this.getScrollbarWidth();
188
+
189
+ _this.hideNativeScrollbar();
190
+ };
191
+
192
+ this.hideScrollbars = function () {
193
+ _this.axis.x.track.rect = _this.axis.x.track.el.getBoundingClientRect();
194
+ _this.axis.y.track.rect = _this.axis.y.track.el.getBoundingClientRect();
195
+
196
+ if (!_this.isWithinBounds(_this.axis.y.track.rect)) {
197
+ _this.axis.y.scrollbar.el.classList.remove(_this.classNames.visible);
198
+
199
+ _this.axis.y.isVisible = false;
200
+ }
201
+
202
+ if (!_this.isWithinBounds(_this.axis.x.track.rect)) {
203
+ _this.axis.x.scrollbar.el.classList.remove(_this.classNames.visible);
204
+
205
+ _this.axis.x.isVisible = false;
206
+ }
207
+ };
208
+
209
+ this.onPointerEvent = function (e) {
210
+ var isWithinTrackXBounds, isWithinTrackYBounds;
211
+ _this.axis.x.track.rect = _this.axis.x.track.el.getBoundingClientRect();
212
+ _this.axis.y.track.rect = _this.axis.y.track.el.getBoundingClientRect();
213
+
214
+ if (_this.axis.x.isOverflowing || _this.axis.x.forceVisible) {
215
+ isWithinTrackXBounds = _this.isWithinBounds(_this.axis.x.track.rect);
216
+ }
217
+
218
+ if (_this.axis.y.isOverflowing || _this.axis.y.forceVisible) {
219
+ isWithinTrackYBounds = _this.isWithinBounds(_this.axis.y.track.rect);
220
+ } // If any pointer event is called on the scrollbar
221
+
222
+
223
+ if (isWithinTrackXBounds || isWithinTrackYBounds) {
224
+ // Preventing the event's default action stops text being
225
+ // selectable during the drag.
226
+ e.preventDefault(); // Prevent event leaking
227
+
228
+ e.stopPropagation();
229
+
230
+ if (e.type === 'mousedown') {
231
+ if (isWithinTrackXBounds) {
232
+ _this.axis.x.scrollbar.rect = _this.axis.x.scrollbar.el.getBoundingClientRect();
233
+
234
+ if (_this.isWithinBounds(_this.axis.x.scrollbar.rect)) {
235
+ _this.onDragStart(e, 'x');
236
+ } else {
237
+ _this.onTrackClick(e, 'x');
238
+ }
239
+ }
240
+
241
+ if (isWithinTrackYBounds) {
242
+ _this.axis.y.scrollbar.rect = _this.axis.y.scrollbar.el.getBoundingClientRect();
243
+
244
+ if (_this.isWithinBounds(_this.axis.y.scrollbar.rect)) {
245
+ _this.onDragStart(e, 'y');
246
+ } else {
247
+ _this.onTrackClick(e, 'y');
248
+ }
249
+ }
250
+ }
251
+ }
252
+ };
253
+
254
+ this.drag = function (e) {
255
+ var eventOffset;
256
+ var track = _this.axis[_this.draggedAxis].track;
257
+ var trackSize = track.rect[_this.axis[_this.draggedAxis].sizeAttr];
258
+ var scrollbar = _this.axis[_this.draggedAxis].scrollbar;
259
+ var contentSize = _this.contentWrapperEl[_this.axis[_this.draggedAxis].scrollSizeAttr];
260
+ var hostSize = parseInt(_this.elStyles[_this.axis[_this.draggedAxis].sizeAttr], 10);
261
+ e.preventDefault();
262
+ e.stopPropagation();
263
+
264
+ if (_this.draggedAxis === 'y') {
265
+ eventOffset = e.pageY;
266
+ } else {
267
+ eventOffset = e.pageX;
268
+ } // Calculate how far the user's mouse is from the top/left of the scrollbar (minus the dragOffset).
269
+
270
+
271
+ var dragPos = eventOffset - track.rect[_this.axis[_this.draggedAxis].offsetAttr] - _this.axis[_this.draggedAxis].dragOffset; // Convert the mouse position into a percentage of the scrollbar height/width.
272
+
273
+ var dragPerc = dragPos / (trackSize - scrollbar.size); // Scroll the content by the same percentage.
274
+
275
+ var scrollPos = dragPerc * (contentSize - hostSize); // Fix browsers inconsistency on RTL
276
+
277
+ if (_this.draggedAxis === 'x') {
278
+ scrollPos = _this.isRtl && SimpleBar.getRtlHelpers().isRtlScrollbarInverted ? scrollPos - (trackSize + scrollbar.size) : scrollPos;
279
+ scrollPos = _this.isRtl && SimpleBar.getRtlHelpers().isRtlScrollingInverted ? -scrollPos : scrollPos;
280
+ }
281
+
282
+ _this.contentWrapperEl[_this.axis[_this.draggedAxis].scrollOffsetAttr] = scrollPos;
283
+ };
284
+
285
+ this.onEndDrag = function (e) {
286
+ var elDocument = getElementDocument(_this.el);
287
+ var elWindow = getElementWindow(_this.el);
288
+ e.preventDefault();
289
+ e.stopPropagation();
290
+
291
+ _this.el.classList.remove(_this.classNames.dragging);
292
+
293
+ elDocument.removeEventListener('mousemove', _this.drag, true);
294
+ elDocument.removeEventListener('mouseup', _this.onEndDrag, true);
295
+ _this.removePreventClickId = elWindow.setTimeout(function () {
296
+ // Remove these asynchronously so we still suppress click events
297
+ // generated simultaneously with mouseup.
298
+ elDocument.removeEventListener('click', _this.preventClick, true);
299
+ elDocument.removeEventListener('dblclick', _this.preventClick, true);
300
+ _this.removePreventClickId = null;
301
+ });
302
+ };
303
+
304
+ this.preventClick = function (e) {
305
+ e.preventDefault();
306
+ e.stopPropagation();
307
+ };
308
+
309
+ this.el = element;
310
+ this.minScrollbarWidth = 20;
311
+ this.options = Object.assign({}, SimpleBar.defaultOptions, {}, options);
312
+ this.classNames = Object.assign({}, SimpleBar.defaultOptions.classNames, {}, this.options.classNames);
313
+ this.axis = {
314
+ x: {
315
+ scrollOffsetAttr: 'scrollLeft',
316
+ sizeAttr: 'width',
317
+ scrollSizeAttr: 'scrollWidth',
318
+ offsetSizeAttr: 'offsetWidth',
319
+ offsetAttr: 'left',
320
+ overflowAttr: 'overflowX',
321
+ dragOffset: 0,
322
+ isOverflowing: true,
323
+ isVisible: false,
324
+ forceVisible: false,
325
+ track: {},
326
+ scrollbar: {}
327
+ },
328
+ y: {
329
+ scrollOffsetAttr: 'scrollTop',
330
+ sizeAttr: 'height',
331
+ scrollSizeAttr: 'scrollHeight',
332
+ offsetSizeAttr: 'offsetHeight',
333
+ offsetAttr: 'top',
334
+ overflowAttr: 'overflowY',
335
+ dragOffset: 0,
336
+ isOverflowing: true,
337
+ isVisible: false,
338
+ forceVisible: false,
339
+ track: {},
340
+ scrollbar: {}
341
+ }
342
+ };
343
+ this.removePreventClickId = null; // Don't re-instantiate over an existing one
344
+
345
+ if (SimpleBar.instances.has(this.el)) {
346
+ return;
347
+ }
348
+
349
+ this.recalculate = throttle(this.recalculate.bind(this), 64);
350
+ this.onMouseMove = throttle(this.onMouseMove.bind(this), 64);
351
+ this.hideScrollbars = debounce(this.hideScrollbars.bind(this), this.options.timeout);
352
+ this.onWindowResize = debounce(this.onWindowResize.bind(this), 64, {
353
+ leading: true
354
+ });
355
+ SimpleBar.getRtlHelpers = memoize(SimpleBar.getRtlHelpers);
356
+ this.init();
357
+ }
358
+ /**
359
+ * Static properties
360
+ */
361
+
362
+ /**
363
+ * Helper to fix browsers inconsistency on RTL:
364
+ * - Firefox inverts the scrollbar initial position
365
+ * - IE11 inverts both scrollbar position and scrolling offset
366
+ * Directly inspired by @KingSora's OverlayScrollbars https://github.com/KingSora/OverlayScrollbars/blob/master/js/OverlayScrollbars.js#L1634
367
+ */
368
+
369
+
370
+ SimpleBar.getRtlHelpers = function getRtlHelpers() {
371
+ var dummyDiv = document.createElement('div');
372
+ dummyDiv.innerHTML = '<div class="hs-dummy-scrollbar-size"><div style="height: 200%; width: 200%; margin: 10px 0;"></div></div>';
373
+ var scrollbarDummyEl = dummyDiv.firstElementChild;
374
+ document.body.appendChild(scrollbarDummyEl);
375
+ var dummyContainerChild = scrollbarDummyEl.firstElementChild;
376
+ scrollbarDummyEl.scrollLeft = 0;
377
+ var dummyContainerOffset = SimpleBar.getOffset(scrollbarDummyEl);
378
+ var dummyContainerChildOffset = SimpleBar.getOffset(dummyContainerChild);
379
+ scrollbarDummyEl.scrollLeft = 999;
380
+ var dummyContainerScrollOffsetAfterScroll = SimpleBar.getOffset(dummyContainerChild);
381
+ return {
382
+ // determines if the scrolling is responding with negative values
383
+ isRtlScrollingInverted: dummyContainerOffset.left !== dummyContainerChildOffset.left && dummyContainerChildOffset.left - dummyContainerScrollOffsetAfterScroll.left !== 0,
384
+ // determines if the origin scrollbar position is inverted or not (positioned on left or right)
385
+ isRtlScrollbarInverted: dummyContainerOffset.left !== dummyContainerChildOffset.left
386
+ };
387
+ };
388
+
389
+ SimpleBar.getOffset = function getOffset(el) {
390
+ var rect = el.getBoundingClientRect();
391
+ var elDocument = getElementDocument(el);
392
+ var elWindow = getElementWindow(el);
393
+ return {
394
+ top: rect.top + (elWindow.pageYOffset || elDocument.documentElement.scrollTop),
395
+ left: rect.left + (elWindow.pageXOffset || elDocument.documentElement.scrollLeft)
396
+ };
397
+ };
398
+
399
+ var _proto = SimpleBar.prototype;
400
+
401
+ _proto.init = function init() {
402
+ // Save a reference to the instance, so we know this DOM node has already been instancied
403
+ SimpleBar.instances.set(this.el, this); // We stop here on server-side
404
+
405
+ if (canUseDOM) {
406
+ this.initDOM();
407
+ this.scrollbarWidth = this.getScrollbarWidth();
408
+ this.recalculate();
409
+ this.initListeners();
410
+ }
411
+ };
412
+
413
+ _proto.initDOM = function initDOM() {
414
+ var _this2 = this;
415
+
416
+ // make sure this element doesn't have the elements yet
417
+ if (Array.prototype.filter.call(this.el.children, function (child) {
418
+ return child.classList.contains(_this2.classNames.wrapper);
419
+ }).length) {
420
+ // assume that element has his DOM already initiated
421
+ this.wrapperEl = this.el.querySelector("." + this.classNames.wrapper);
422
+ this.contentWrapperEl = this.options.scrollableNode || this.el.querySelector("." + this.classNames.contentWrapper);
423
+ this.contentEl = this.options.contentNode || this.el.querySelector("." + this.classNames.contentEl);
424
+ this.offsetEl = this.el.querySelector("." + this.classNames.offset);
425
+ this.maskEl = this.el.querySelector("." + this.classNames.mask);
426
+ this.placeholderEl = this.findChild(this.wrapperEl, "." + this.classNames.placeholder);
427
+ this.heightAutoObserverWrapperEl = this.el.querySelector("." + this.classNames.heightAutoObserverWrapperEl);
428
+ this.heightAutoObserverEl = this.el.querySelector("." + this.classNames.heightAutoObserverEl);
429
+ this.axis.x.track.el = this.findChild(this.el, "." + this.classNames.track + "." + this.classNames.horizontal);
430
+ this.axis.y.track.el = this.findChild(this.el, "." + this.classNames.track + "." + this.classNames.vertical);
431
+ } else {
432
+ // Prepare DOM
433
+ this.wrapperEl = document.createElement('div');
434
+ this.contentWrapperEl = document.createElement('div');
435
+ this.offsetEl = document.createElement('div');
436
+ this.maskEl = document.createElement('div');
437
+ this.contentEl = document.createElement('div');
438
+ this.placeholderEl = document.createElement('div');
439
+ this.heightAutoObserverWrapperEl = document.createElement('div');
440
+ this.heightAutoObserverEl = document.createElement('div');
441
+ this.wrapperEl.classList.add(this.classNames.wrapper);
442
+ this.contentWrapperEl.classList.add(this.classNames.contentWrapper);
443
+ this.offsetEl.classList.add(this.classNames.offset);
444
+ this.maskEl.classList.add(this.classNames.mask);
445
+ this.contentEl.classList.add(this.classNames.contentEl);
446
+ this.placeholderEl.classList.add(this.classNames.placeholder);
447
+ this.heightAutoObserverWrapperEl.classList.add(this.classNames.heightAutoObserverWrapperEl);
448
+ this.heightAutoObserverEl.classList.add(this.classNames.heightAutoObserverEl);
449
+
450
+ while (this.el.firstChild) {
451
+ this.contentEl.appendChild(this.el.firstChild);
452
+ }
453
+
454
+ this.contentWrapperEl.appendChild(this.contentEl);
455
+ this.offsetEl.appendChild(this.contentWrapperEl);
456
+ this.maskEl.appendChild(this.offsetEl);
457
+ this.heightAutoObserverWrapperEl.appendChild(this.heightAutoObserverEl);
458
+ this.wrapperEl.appendChild(this.heightAutoObserverWrapperEl);
459
+ this.wrapperEl.appendChild(this.maskEl);
460
+ this.wrapperEl.appendChild(this.placeholderEl);
461
+ this.el.appendChild(this.wrapperEl);
462
+ }
463
+
464
+ if (!this.axis.x.track.el || !this.axis.y.track.el) {
465
+ var track = document.createElement('div');
466
+ var scrollbar = document.createElement('div');
467
+ track.classList.add(this.classNames.track);
468
+ scrollbar.classList.add(this.classNames.scrollbar);
469
+ track.appendChild(scrollbar);
470
+ this.axis.x.track.el = track.cloneNode(true);
471
+ this.axis.x.track.el.classList.add(this.classNames.horizontal);
472
+ this.axis.y.track.el = track.cloneNode(true);
473
+ this.axis.y.track.el.classList.add(this.classNames.vertical);
474
+ this.el.appendChild(this.axis.x.track.el);
475
+ this.el.appendChild(this.axis.y.track.el);
476
+ }
477
+
478
+ this.axis.x.scrollbar.el = this.axis.x.track.el.querySelector("." + this.classNames.scrollbar);
479
+ this.axis.y.scrollbar.el = this.axis.y.track.el.querySelector("." + this.classNames.scrollbar);
480
+
481
+ if (!this.options.autoHide) {
482
+ this.axis.x.scrollbar.el.classList.add(this.classNames.visible);
483
+ this.axis.y.scrollbar.el.classList.add(this.classNames.visible);
484
+ }
485
+
486
+ this.el.setAttribute('data-simplebar', 'init');
487
+ };
488
+
489
+ _proto.initListeners = function initListeners() {
490
+ var _this3 = this;
491
+
492
+ var elWindow = getElementWindow(this.el); // Event listeners
493
+
494
+ if (this.options.autoHide) {
495
+ this.el.addEventListener('mouseenter', this.onMouseEnter);
496
+ }
497
+
498
+ ['mousedown', 'click', 'dblclick'].forEach(function (e) {
499
+ _this3.el.addEventListener(e, _this3.onPointerEvent, true);
500
+ });
501
+ ['touchstart', 'touchend', 'touchmove'].forEach(function (e) {
502
+ _this3.el.addEventListener(e, _this3.onPointerEvent, {
503
+ capture: true,
504
+ passive: true
505
+ });
506
+ });
507
+ this.el.addEventListener('mousemove', this.onMouseMove);
508
+ this.el.addEventListener('mouseleave', this.onMouseLeave);
509
+ this.contentWrapperEl.addEventListener('scroll', this.onScroll); // Browser zoom triggers a window resize
510
+
511
+ elWindow.addEventListener('resize', this.onWindowResize); // Hack for https://github.com/WICG/ResizeObserver/issues/38
512
+
513
+ var resizeObserverStarted = false;
514
+ var resizeObserver = elWindow.ResizeObserver || ResizeObserver;
515
+ this.resizeObserver = new resizeObserver(function () {
516
+ if (!resizeObserverStarted) return;
517
+
518
+ _this3.recalculate();
519
+ });
520
+ this.resizeObserver.observe(this.el);
521
+ this.resizeObserver.observe(this.contentEl);
522
+ elWindow.requestAnimationFrame(function () {
523
+ resizeObserverStarted = true;
524
+ }); // This is required to detect horizontal scroll. Vertical scroll only needs the resizeObserver.
525
+
526
+ this.mutationObserver = new elWindow.MutationObserver(this.recalculate);
527
+ this.mutationObserver.observe(this.contentEl, {
528
+ childList: true,
529
+ subtree: true,
530
+ characterData: true
531
+ });
532
+ };
533
+
534
+ _proto.recalculate = function recalculate() {
535
+ var elWindow = getElementWindow(this.el);
536
+ this.elStyles = elWindow.getComputedStyle(this.el);
537
+ this.isRtl = this.elStyles.direction === 'rtl';
538
+ var isHeightAuto = this.heightAutoObserverEl.offsetHeight <= 1;
539
+ var isWidthAuto = this.heightAutoObserverEl.offsetWidth <= 1;
540
+ var contentElOffsetWidth = this.contentEl.offsetWidth;
541
+ var contentWrapperElOffsetWidth = this.contentWrapperEl.offsetWidth;
542
+ var elOverflowX = this.elStyles.overflowX;
543
+ var elOverflowY = this.elStyles.overflowY;
544
+ this.contentEl.style.padding = this.elStyles.paddingTop + " " + this.elStyles.paddingRight + " " + this.elStyles.paddingBottom + " " + this.elStyles.paddingLeft;
545
+ this.wrapperEl.style.margin = "-" + this.elStyles.paddingTop + " -" + this.elStyles.paddingRight + " -" + this.elStyles.paddingBottom + " -" + this.elStyles.paddingLeft;
546
+ var contentElScrollHeight = this.contentEl.scrollHeight;
547
+ var contentElScrollWidth = this.contentEl.scrollWidth;
548
+ this.contentWrapperEl.style.height = isHeightAuto ? 'auto' : '100%'; // Determine placeholder size
549
+
550
+ this.placeholderEl.style.width = isWidthAuto ? contentElOffsetWidth + "px" : 'auto';
551
+ this.placeholderEl.style.height = contentElScrollHeight + "px";
552
+ var contentWrapperElOffsetHeight = this.contentWrapperEl.offsetHeight;
553
+ this.axis.x.isOverflowing = contentElScrollWidth > contentElOffsetWidth;
554
+ this.axis.y.isOverflowing = contentElScrollHeight > contentWrapperElOffsetHeight; // Set isOverflowing to false if user explicitely set hidden overflow
555
+
556
+ this.axis.x.isOverflowing = elOverflowX === 'hidden' ? false : this.axis.x.isOverflowing;
557
+ this.axis.y.isOverflowing = elOverflowY === 'hidden' ? false : this.axis.y.isOverflowing;
558
+ this.axis.x.forceVisible = this.options.forceVisible === 'x' || this.options.forceVisible === true;
559
+ this.axis.y.forceVisible = this.options.forceVisible === 'y' || this.options.forceVisible === true;
560
+ this.hideNativeScrollbar(); // Set isOverflowing to false if scrollbar is not necessary (content is shorter than offset)
561
+
562
+ var offsetForXScrollbar = this.axis.x.isOverflowing ? this.scrollbarWidth : 0;
563
+ var offsetForYScrollbar = this.axis.y.isOverflowing ? this.scrollbarWidth : 0;
564
+ this.axis.x.isOverflowing = this.axis.x.isOverflowing && contentElScrollWidth > contentWrapperElOffsetWidth - offsetForYScrollbar;
565
+ this.axis.y.isOverflowing = this.axis.y.isOverflowing && contentElScrollHeight > contentWrapperElOffsetHeight - offsetForXScrollbar;
566
+ this.axis.x.scrollbar.size = this.getScrollbarSize('x');
567
+ this.axis.y.scrollbar.size = this.getScrollbarSize('y');
568
+ this.axis.x.scrollbar.el.style.width = this.axis.x.scrollbar.size + "px";
569
+ this.axis.y.scrollbar.el.style.height = this.axis.y.scrollbar.size + "px";
570
+ this.positionScrollbar('x');
571
+ this.positionScrollbar('y');
572
+ this.toggleTrackVisibility('x');
573
+ this.toggleTrackVisibility('y');
574
+ }
575
+ /**
576
+ * Calculate scrollbar size
577
+ */
578
+ ;
579
+
580
+ _proto.getScrollbarSize = function getScrollbarSize(axis) {
581
+ if (axis === void 0) {
582
+ axis = 'y';
583
+ }
584
+
585
+ if (!this.axis[axis].isOverflowing) {
586
+ return 0;
587
+ }
588
+
589
+ var contentSize = this.contentEl[this.axis[axis].scrollSizeAttr];
590
+ var trackSize = this.axis[axis].track.el[this.axis[axis].offsetSizeAttr];
591
+ var scrollbarSize;
592
+ var scrollbarRatio = trackSize / contentSize; // Calculate new height/position of drag handle.
593
+
594
+ scrollbarSize = Math.max(~~(scrollbarRatio * trackSize), this.options.scrollbarMinSize);
595
+
596
+ if (this.options.scrollbarMaxSize) {
597
+ scrollbarSize = Math.min(scrollbarSize, this.options.scrollbarMaxSize);
598
+ }
599
+
600
+ return scrollbarSize;
601
+ };
602
+
603
+ _proto.positionScrollbar = function positionScrollbar(axis) {
604
+ if (axis === void 0) {
605
+ axis = 'y';
606
+ }
607
+
608
+ if (!this.axis[axis].isOverflowing) {
609
+ return;
610
+ }
611
+
612
+ var contentSize = this.contentWrapperEl[this.axis[axis].scrollSizeAttr];
613
+ var trackSize = this.axis[axis].track.el[this.axis[axis].offsetSizeAttr];
614
+ var hostSize = parseInt(this.elStyles[this.axis[axis].sizeAttr], 10);
615
+ var scrollbar = this.axis[axis].scrollbar;
616
+ var scrollOffset = this.contentWrapperEl[this.axis[axis].scrollOffsetAttr];
617
+ scrollOffset = axis === 'x' && this.isRtl && SimpleBar.getRtlHelpers().isRtlScrollingInverted ? -scrollOffset : scrollOffset;
618
+ var scrollPourcent = scrollOffset / (contentSize - hostSize);
619
+ var handleOffset = ~~((trackSize - scrollbar.size) * scrollPourcent);
620
+ handleOffset = axis === 'x' && this.isRtl && SimpleBar.getRtlHelpers().isRtlScrollbarInverted ? handleOffset + (trackSize - scrollbar.size) : handleOffset;
621
+ scrollbar.el.style.transform = axis === 'x' ? "translate3d(" + handleOffset + "px, 0, 0)" : "translate3d(0, " + handleOffset + "px, 0)";
622
+ };
623
+
624
+ _proto.toggleTrackVisibility = function toggleTrackVisibility(axis) {
625
+ if (axis === void 0) {
626
+ axis = 'y';
627
+ }
628
+
629
+ var track = this.axis[axis].track.el;
630
+ var scrollbar = this.axis[axis].scrollbar.el;
631
+
632
+ if (this.axis[axis].isOverflowing || this.axis[axis].forceVisible) {
633
+ track.style.visibility = 'visible';
634
+ this.contentWrapperEl.style[this.axis[axis].overflowAttr] = 'scroll';
635
+ } else {
636
+ track.style.visibility = 'hidden';
637
+ this.contentWrapperEl.style[this.axis[axis].overflowAttr] = 'hidden';
638
+ } // Even if forceVisible is enabled, scrollbar itself should be hidden
639
+
640
+
641
+ if (this.axis[axis].isOverflowing) {
642
+ scrollbar.style.display = 'block';
643
+ } else {
644
+ scrollbar.style.display = 'none';
645
+ }
646
+ };
647
+
648
+ _proto.hideNativeScrollbar = function hideNativeScrollbar() {
649
+ this.offsetEl.style[this.isRtl ? 'left' : 'right'] = this.axis.y.isOverflowing || this.axis.y.forceVisible ? "-" + this.scrollbarWidth + "px" : 0;
650
+ this.offsetEl.style.bottom = this.axis.x.isOverflowing || this.axis.x.forceVisible ? "-" + this.scrollbarWidth + "px" : 0;
651
+ }
652
+ /**
653
+ * On scroll event handling
654
+ */
655
+ ;
656
+
657
+ _proto.onMouseMoveForAxis = function onMouseMoveForAxis(axis) {
658
+ if (axis === void 0) {
659
+ axis = 'y';
660
+ }
661
+
662
+ this.axis[axis].track.rect = this.axis[axis].track.el.getBoundingClientRect();
663
+ this.axis[axis].scrollbar.rect = this.axis[axis].scrollbar.el.getBoundingClientRect();
664
+ var isWithinScrollbarBoundsX = this.isWithinBounds(this.axis[axis].scrollbar.rect);
665
+
666
+ if (isWithinScrollbarBoundsX) {
667
+ this.axis[axis].scrollbar.el.classList.add(this.classNames.hover);
668
+ } else {
669
+ this.axis[axis].scrollbar.el.classList.remove(this.classNames.hover);
670
+ }
671
+
672
+ if (this.isWithinBounds(this.axis[axis].track.rect)) {
673
+ this.showScrollbar(axis);
674
+ this.axis[axis].track.el.classList.add(this.classNames.hover);
675
+ } else {
676
+ this.axis[axis].track.el.classList.remove(this.classNames.hover);
677
+ }
678
+ };
679
+
680
+ _proto.onMouseLeaveForAxis = function onMouseLeaveForAxis(axis) {
681
+ if (axis === void 0) {
682
+ axis = 'y';
683
+ }
684
+
685
+ this.axis[axis].track.el.classList.remove(this.classNames.hover);
686
+ this.axis[axis].scrollbar.el.classList.remove(this.classNames.hover);
687
+ };
688
+
689
+ /**
690
+ * Show scrollbar
691
+ */
692
+ _proto.showScrollbar = function showScrollbar(axis) {
693
+ if (axis === void 0) {
694
+ axis = 'y';
695
+ }
696
+
697
+ var scrollbar = this.axis[axis].scrollbar.el;
698
+
699
+ if (!this.axis[axis].isVisible) {
700
+ scrollbar.classList.add(this.classNames.visible);
701
+ this.axis[axis].isVisible = true;
702
+ }
703
+
704
+ if (this.options.autoHide) {
705
+ this.hideScrollbars();
706
+ }
707
+ }
708
+ /**
709
+ * Hide Scrollbar
710
+ */
711
+ ;
712
+
713
+ /**
714
+ * on scrollbar handle drag movement starts
715
+ */
716
+ _proto.onDragStart = function onDragStart(e, axis) {
717
+ if (axis === void 0) {
718
+ axis = 'y';
719
+ }
720
+
721
+ var elDocument = getElementDocument(this.el);
722
+ var elWindow = getElementWindow(this.el);
723
+ var scrollbar = this.axis[axis].scrollbar; // Measure how far the user's mouse is from the top of the scrollbar drag handle.
724
+
725
+ var eventOffset = axis === 'y' ? e.pageY : e.pageX;
726
+ this.axis[axis].dragOffset = eventOffset - scrollbar.rect[this.axis[axis].offsetAttr];
727
+ this.draggedAxis = axis;
728
+ this.el.classList.add(this.classNames.dragging);
729
+ elDocument.addEventListener('mousemove', this.drag, true);
730
+ elDocument.addEventListener('mouseup', this.onEndDrag, true);
731
+
732
+ if (this.removePreventClickId === null) {
733
+ elDocument.addEventListener('click', this.preventClick, true);
734
+ elDocument.addEventListener('dblclick', this.preventClick, true);
735
+ } else {
736
+ elWindow.clearTimeout(this.removePreventClickId);
737
+ this.removePreventClickId = null;
738
+ }
739
+ }
740
+ /**
741
+ * Drag scrollbar handle
742
+ */
743
+ ;
744
+
745
+ _proto.onTrackClick = function onTrackClick(e, axis) {
746
+ var _this4 = this;
747
+
748
+ if (axis === void 0) {
749
+ axis = 'y';
750
+ }
751
+
752
+ if (!this.options.clickOnTrack) return;
753
+ var elWindow = getElementWindow(this.el);
754
+ this.axis[axis].scrollbar.rect = this.axis[axis].scrollbar.el.getBoundingClientRect();
755
+ var scrollbar = this.axis[axis].scrollbar;
756
+ var scrollbarOffset = scrollbar.rect[this.axis[axis].offsetAttr];
757
+ var hostSize = parseInt(this.elStyles[this.axis[axis].sizeAttr], 10);
758
+ var scrolled = this.contentWrapperEl[this.axis[axis].scrollOffsetAttr];
759
+ var t = axis === 'y' ? this.mouseY - scrollbarOffset : this.mouseX - scrollbarOffset;
760
+ var dir = t < 0 ? -1 : 1;
761
+ var scrollSize = dir === -1 ? scrolled - hostSize : scrolled + hostSize;
762
+
763
+ var scrollTo = function scrollTo() {
764
+ if (dir === -1) {
765
+ if (scrolled > scrollSize) {
766
+ var _this4$contentWrapper;
767
+
768
+ scrolled -= _this4.options.clickOnTrackSpeed;
769
+
770
+ _this4.contentWrapperEl.scrollTo((_this4$contentWrapper = {}, _this4$contentWrapper[_this4.axis[axis].offsetAttr] = scrolled, _this4$contentWrapper));
771
+
772
+ elWindow.requestAnimationFrame(scrollTo);
773
+ }
774
+ } else {
775
+ if (scrolled < scrollSize) {
776
+ var _this4$contentWrapper2;
777
+
778
+ scrolled += _this4.options.clickOnTrackSpeed;
779
+
780
+ _this4.contentWrapperEl.scrollTo((_this4$contentWrapper2 = {}, _this4$contentWrapper2[_this4.axis[axis].offsetAttr] = scrolled, _this4$contentWrapper2));
781
+
782
+ elWindow.requestAnimationFrame(scrollTo);
783
+ }
784
+ }
785
+ };
786
+
787
+ scrollTo();
788
+ }
789
+ /**
790
+ * Getter for content element
791
+ */
792
+ ;
793
+
794
+ _proto.getContentElement = function getContentElement() {
795
+ return this.contentEl;
796
+ }
797
+ /**
798
+ * Getter for original scrolling element
799
+ */
800
+ ;
801
+
802
+ _proto.getScrollElement = function getScrollElement() {
803
+ return this.contentWrapperEl;
804
+ };
805
+
806
+ _proto.getScrollbarWidth = function getScrollbarWidth() {
807
+ // Try/catch for FF 56 throwing on undefined computedStyles
808
+ try {
809
+ // Detect browsers supporting CSS scrollbar styling and do not calculate
810
+ if (getComputedStyle(this.contentWrapperEl, '::-webkit-scrollbar').display === 'none' || 'scrollbarWidth' in document.documentElement.style || '-ms-overflow-style' in document.documentElement.style) {
811
+ return 0;
812
+ } else {
813
+ return scrollbarWidth(this.el);
814
+ }
815
+ } catch (e) {
816
+ return scrollbarWidth(this.el);
817
+ }
818
+ };
819
+
820
+ _proto.removeListeners = function removeListeners() {
821
+ var _this5 = this;
822
+
823
+ var elWindow = getElementWindow(this.el); // Event listeners
824
+
825
+ if (this.options.autoHide) {
826
+ this.el.removeEventListener('mouseenter', this.onMouseEnter);
827
+ }
828
+
829
+ ['mousedown', 'click', 'dblclick'].forEach(function (e) {
830
+ _this5.el.removeEventListener(e, _this5.onPointerEvent, true);
831
+ });
832
+ ['touchstart', 'touchend', 'touchmove'].forEach(function (e) {
833
+ _this5.el.removeEventListener(e, _this5.onPointerEvent, {
834
+ capture: true,
835
+ passive: true
836
+ });
837
+ });
838
+ this.el.removeEventListener('mousemove', this.onMouseMove);
839
+ this.el.removeEventListener('mouseleave', this.onMouseLeave);
840
+
841
+ if (this.contentWrapperEl) {
842
+ this.contentWrapperEl.removeEventListener('scroll', this.onScroll);
843
+ }
844
+
845
+ elWindow.removeEventListener('resize', this.onWindowResize);
846
+
847
+ if (this.mutationObserver) {
848
+ this.mutationObserver.disconnect();
849
+ }
850
+
851
+ if (this.resizeObserver) {
852
+ this.resizeObserver.disconnect();
853
+ } // Cancel all debounced functions
854
+
855
+
856
+ this.recalculate.cancel();
857
+ this.onMouseMove.cancel();
858
+ this.hideScrollbars.cancel();
859
+ this.onWindowResize.cancel();
860
+ }
861
+ /**
862
+ * UnMount mutation observer and delete SimpleBar instance from DOM element
863
+ */
864
+ ;
865
+
866
+ _proto.unMount = function unMount() {
867
+ this.removeListeners();
868
+ SimpleBar.instances.delete(this.el);
869
+ }
870
+ /**
871
+ * Check if mouse is within bounds
872
+ */
873
+ ;
874
+
875
+ _proto.isWithinBounds = function isWithinBounds(bbox) {
876
+ return this.mouseX >= bbox.left && this.mouseX <= bbox.left + bbox.width && this.mouseY >= bbox.top && this.mouseY <= bbox.top + bbox.height;
877
+ }
878
+ /**
879
+ * Find element children matches query
880
+ */
881
+ ;
882
+
883
+ _proto.findChild = function findChild(el, query) {
884
+ var matches = el.matches || el.webkitMatchesSelector || el.mozMatchesSelector || el.msMatchesSelector;
885
+ return Array.prototype.filter.call(el.children, function (child) {
886
+ return matches.call(child, query);
887
+ })[0];
888
+ };
889
+
890
+ return SimpleBar;
891
+ }();
892
+
893
+ SimpleBar.defaultOptions = {
894
+ autoHide: true,
895
+ forceVisible: false,
896
+ clickOnTrack: true,
897
+ clickOnTrackSpeed: 40,
898
+ classNames: {
899
+ contentEl: 'simplebar-content',
900
+ contentWrapper: 'simplebar-content-wrapper',
901
+ offset: 'simplebar-offset',
902
+ mask: 'simplebar-mask',
903
+ wrapper: 'simplebar-wrapper',
904
+ placeholder: 'simplebar-placeholder',
905
+ scrollbar: 'simplebar-scrollbar',
906
+ track: 'simplebar-track',
907
+ heightAutoObserverWrapperEl: 'simplebar-height-auto-observer-wrapper',
908
+ heightAutoObserverEl: 'simplebar-height-auto-observer',
909
+ visible: 'simplebar-visible',
910
+ horizontal: 'simplebar-horizontal',
911
+ vertical: 'simplebar-vertical',
912
+ hover: 'simplebar-hover',
913
+ dragging: 'simplebar-dragging'
914
+ },
915
+ scrollbarMinSize: 25,
916
+ scrollbarMaxSize: 0,
917
+ timeout: 1000
918
+ };
919
+ SimpleBar.instances = new WeakMap();
920
+
921
+ SimpleBar.initDOMLoadedElements = function () {
922
+ document.removeEventListener('DOMContentLoaded', this.initDOMLoadedElements);
923
+ window.removeEventListener('load', this.initDOMLoadedElements);
924
+ Array.prototype.forEach.call(document.querySelectorAll('[data-simplebar]'), function (el) {
925
+ if (el.getAttribute('data-simplebar') !== 'init' && !SimpleBar.instances.has(el)) new SimpleBar(el, getOptions(el.attributes));
926
+ });
927
+ };
928
+
929
+ SimpleBar.removeObserver = function () {
930
+ this.globalObserver.disconnect();
931
+ };
932
+
933
+ SimpleBar.initHtmlApi = function () {
934
+ this.initDOMLoadedElements = this.initDOMLoadedElements.bind(this); // MutationObserver is IE11+
935
+
936
+ if (typeof MutationObserver !== 'undefined') {
937
+ // Mutation observer to observe dynamically added elements
938
+ this.globalObserver = new MutationObserver(SimpleBar.handleMutations);
939
+ this.globalObserver.observe(document, {
940
+ childList: true,
941
+ subtree: true
942
+ });
943
+ } // Taken from jQuery `ready` function
944
+ // Instantiate elements already present on the page
945
+
946
+
947
+ if (document.readyState === 'complete' || document.readyState !== 'loading' && !document.documentElement.doScroll) {
948
+ // Handle it asynchronously to allow scripts the opportunity to delay init
949
+ window.setTimeout(this.initDOMLoadedElements);
950
+ } else {
951
+ document.addEventListener('DOMContentLoaded', this.initDOMLoadedElements);
952
+ window.addEventListener('load', this.initDOMLoadedElements);
953
+ }
954
+ };
955
+
956
+ SimpleBar.handleMutations = function (mutations) {
957
+ mutations.forEach(function (mutation) {
958
+ Array.prototype.forEach.call(mutation.addedNodes, function (addedNode) {
959
+ if (addedNode.nodeType === 1) {
960
+ if (addedNode.hasAttribute('data-simplebar')) {
961
+ !SimpleBar.instances.has(addedNode) && document.documentElement.contains(addedNode) && new SimpleBar(addedNode, getOptions(addedNode.attributes));
962
+ } else {
963
+ Array.prototype.forEach.call(addedNode.querySelectorAll('[data-simplebar]'), function (el) {
964
+ if (el.getAttribute('data-simplebar') !== 'init' && !SimpleBar.instances.has(el) && document.documentElement.contains(el)) new SimpleBar(el, getOptions(el.attributes));
965
+ });
966
+ }
967
+ }
968
+ });
969
+ Array.prototype.forEach.call(mutation.removedNodes, function (removedNode) {
970
+ if (removedNode.nodeType === 1) {
971
+ if (removedNode.getAttribute('data-simplebar') === 'init') {
972
+ SimpleBar.instances.has(removedNode) && !document.documentElement.contains(removedNode) && SimpleBar.instances.get(removedNode).unMount();
973
+ } else {
974
+ Array.prototype.forEach.call(removedNode.querySelectorAll('[data-simplebar="init"]'), function (el) {
975
+ SimpleBar.instances.has(el) && !document.documentElement.contains(el) && SimpleBar.instances.get(el).unMount();
976
+ });
977
+ }
978
+ }
979
+ });
980
+ });
981
+ };
982
+
983
+ SimpleBar.getOptions = getOptions;
984
+ /**
985
+ * HTML API
986
+ * Called only in a browser env.
987
+ */
988
+
989
+ if (canUseDOM) {
990
+ SimpleBar.initHtmlApi();
991
+ }
992
+
993
+ export default SimpleBar;
994
+ //# sourceMappingURL=simplebar.esm.js.map