@lumx/react 3.20.1-alpha.28 → 3.20.1-alpha.29

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 (197) hide show
  1. package/index.js +14033 -63
  2. package/index.js.map +1 -1
  3. package/package.json +3 -3
  4. package/utils/index.js +158 -3
  5. package/utils/index.js.map +1 -1
  6. package/_internal/Button-5a87fee9.js +0 -97
  7. package/_internal/Button-5a87fee9.js.map +0 -1
  8. package/_internal/ButtonRoot-bf682215.js +0 -117
  9. package/_internal/ButtonRoot-bf682215.js.map +0 -1
  10. package/_internal/Chip-8d0aae06.js +0 -143
  11. package/_internal/Chip-8d0aae06.js.map +0 -1
  12. package/_internal/ClickAwayProvider-1204f237.js +0 -95
  13. package/_internal/ClickAwayProvider-1204f237.js.map +0 -1
  14. package/_internal/DisabledStateContext-ea04260d.js +0 -29
  15. package/_internal/DisabledStateContext-ea04260d.js.map +0 -1
  16. package/_internal/HeadingLevelProvider-ebdcb0c7.js +0 -61
  17. package/_internal/HeadingLevelProvider-ebdcb0c7.js.map +0 -1
  18. package/_internal/IconButton-351389b0.js +0 -77
  19. package/_internal/IconButton-351389b0.js.map +0 -1
  20. package/_internal/ImageCaption-4109b433.js +0 -75
  21. package/_internal/ImageCaption-4109b433.js.map +0 -1
  22. package/_internal/List-b7882a99.js +0 -817
  23. package/_internal/List-b7882a99.js.map +0 -1
  24. package/_internal/PopoverDialog-2e7b9ed5.js +0 -655
  25. package/_internal/PopoverDialog-2e7b9ed5.js.map +0 -1
  26. package/_internal/Portal-3f86608e.js +0 -45
  27. package/_internal/Portal-3f86608e.js.map +0 -1
  28. package/_internal/RawClickable-2c2b6a89.js +0 -52
  29. package/_internal/RawClickable-2c2b6a89.js.map +0 -1
  30. package/_internal/Slides-83646e84.js +0 -679
  31. package/_internal/Slides-83646e84.js.map +0 -1
  32. package/_internal/ThemeContext-3181f000.js +0 -14
  33. package/_internal/ThemeContext-3181f000.js.map +0 -1
  34. package/_internal/Thumbnail-741501a5.js +0 -314
  35. package/_internal/Thumbnail-741501a5.js.map +0 -1
  36. package/_internal/check-circle-de24f857.js +0 -4
  37. package/_internal/check-circle-de24f857.js.map +0 -1
  38. package/_internal/chevron-right-827b804a.js +0 -6
  39. package/_internal/chevron-right-827b804a.js.map +0 -1
  40. package/_internal/chevron-up-0b9c76cb.js +0 -6
  41. package/_internal/chevron-up-0b9c76cb.js.map +0 -1
  42. package/_internal/close-circle-ef5d1aac.js +0 -4
  43. package/_internal/close-circle-ef5d1aac.js.map +0 -1
  44. package/_internal/close-eaf6c45a.js +0 -4
  45. package/_internal/close-eaf6c45a.js.map +0 -1
  46. package/_internal/components/alert-dialog-5df4f133.js +0 -163
  47. package/_internal/components/alert-dialog-5df4f133.js.map +0 -1
  48. package/_internal/components/autocomplete-824c779e.js +0 -261
  49. package/_internal/components/autocomplete-824c779e.js.map +0 -1
  50. package/_internal/components/avatar-69b66f01.js +0 -83
  51. package/_internal/components/avatar-69b66f01.js.map +0 -1
  52. package/_internal/components/badge-63cd3b1c.js +0 -81
  53. package/_internal/components/badge-63cd3b1c.js.map +0 -1
  54. package/_internal/components/button-eebd4e00.js +0 -47
  55. package/_internal/components/button-eebd4e00.js.map +0 -1
  56. package/_internal/components/checkbox-54943a02.js +0 -143
  57. package/_internal/components/checkbox-54943a02.js.map +0 -1
  58. package/_internal/components/chip-9ad6b318.js +0 -102
  59. package/_internal/components/chip-9ad6b318.js.map +0 -1
  60. package/_internal/components/comment-block-55a4ab3c.js +0 -138
  61. package/_internal/components/comment-block-55a4ab3c.js.map +0 -1
  62. package/_internal/components/date-picker-a824a3ae.js +0 -2
  63. package/_internal/components/date-picker-a824a3ae.js.map +0 -1
  64. package/_internal/components/dialog-5e6320b8.js +0 -238
  65. package/_internal/components/dialog-5e6320b8.js.map +0 -1
  66. package/_internal/components/divider-bdf11ba3.js +0 -50
  67. package/_internal/components/divider-bdf11ba3.js.map +0 -1
  68. package/_internal/components/drag-handle-45912fd3.js +0 -52
  69. package/_internal/components/drag-handle-45912fd3.js.map +0 -1
  70. package/_internal/components/dropdown-0216211d.js +0 -147
  71. package/_internal/components/dropdown-0216211d.js.map +0 -1
  72. package/_internal/components/expansion-panel-3ce73c6b.js +0 -167
  73. package/_internal/components/expansion-panel-3ce73c6b.js.map +0 -1
  74. package/_internal/components/flag-1b177f78.js +0 -59
  75. package/_internal/components/flag-1b177f78.js.map +0 -1
  76. package/_internal/components/flex-box-93b97715.js +0 -56
  77. package/_internal/components/flex-box-93b97715.js.map +0 -1
  78. package/_internal/components/generic-block-925f7c5b.js +0 -128
  79. package/_internal/components/generic-block-925f7c5b.js.map +0 -1
  80. package/_internal/components/grid-95fd1493.js +0 -104
  81. package/_internal/components/grid-95fd1493.js.map +0 -1
  82. package/_internal/components/grid-column-43f28cfb.js +0 -58
  83. package/_internal/components/grid-column-43f28cfb.js.map +0 -1
  84. package/_internal/components/heading-45d6e78e.js +0 -53
  85. package/_internal/components/heading-45d6e78e.js.map +0 -1
  86. package/_internal/components/icon-79195151.js +0 -2
  87. package/_internal/components/icon-79195151.js.map +0 -1
  88. package/_internal/components/image-block-aba6d2db.js +0 -110
  89. package/_internal/components/image-block-aba6d2db.js.map +0 -1
  90. package/_internal/components/image-lightbox-8b8e77c2.js +0 -759
  91. package/_internal/components/image-lightbox-8b8e77c2.js.map +0 -1
  92. package/_internal/components/inline-list-dfb9fd34.js +0 -74
  93. package/_internal/components/inline-list-dfb9fd34.js.map +0 -1
  94. package/_internal/components/input-helper-c8a0078b.js +0 -71
  95. package/_internal/components/input-helper-c8a0078b.js.map +0 -1
  96. package/_internal/components/input-label-9711398b.js +0 -59
  97. package/_internal/components/input-label-9711398b.js.map +0 -1
  98. package/_internal/components/lightbox-894abe64.js +0 -155
  99. package/_internal/components/lightbox-894abe64.js.map +0 -1
  100. package/_internal/components/link-e70e64ed.js +0 -72
  101. package/_internal/components/link-e70e64ed.js.map +0 -1
  102. package/_internal/components/link-preview-e56f3570.js +0 -117
  103. package/_internal/components/link-preview-e56f3570.js.map +0 -1
  104. package/_internal/components/list-59b7ce56.js +0 -71
  105. package/_internal/components/list-59b7ce56.js.map +0 -1
  106. package/_internal/components/message-a255dfd3.js +0 -98
  107. package/_internal/components/message-a255dfd3.js.map +0 -1
  108. package/_internal/components/mosaic-192f2270.js +0 -94
  109. package/_internal/components/mosaic-192f2270.js.map +0 -1
  110. package/_internal/components/navigation-dfe8aac0.js +0 -225
  111. package/_internal/components/navigation-dfe8aac0.js.map +0 -1
  112. package/_internal/components/notification-10f289b5.js +0 -143
  113. package/_internal/components/notification-10f289b5.js.map +0 -1
  114. package/_internal/components/popover-6c7f745b.js +0 -3
  115. package/_internal/components/popover-6c7f745b.js.map +0 -1
  116. package/_internal/components/post-block-f7dcc6e9.js +0 -109
  117. package/_internal/components/post-block-f7dcc6e9.js.map +0 -1
  118. package/_internal/components/progress-7a05fb0c.js +0 -182
  119. package/_internal/components/progress-7a05fb0c.js.map +0 -1
  120. package/_internal/components/progress-tracker-48876add.js +0 -309
  121. package/_internal/components/progress-tracker-48876add.js.map +0 -1
  122. package/_internal/components/radio-button-07cf45e9.js +0 -149
  123. package/_internal/components/radio-button-07cf45e9.js.map +0 -1
  124. package/_internal/components/select-8b54a444.js +0 -457
  125. package/_internal/components/select-8b54a444.js.map +0 -1
  126. package/_internal/components/side-navigation-7eeed3b4.js +0 -164
  127. package/_internal/components/side-navigation-7eeed3b4.js.map +0 -1
  128. package/_internal/components/skeleton-a4e84085.js +0 -166
  129. package/_internal/components/skeleton-a4e84085.js.map +0 -1
  130. package/_internal/components/slider-5d64b470.js +0 -311
  131. package/_internal/components/slider-5d64b470.js.map +0 -1
  132. package/_internal/components/slideshow-bce65cf6.js +0 -151
  133. package/_internal/components/slideshow-bce65cf6.js.map +0 -1
  134. package/_internal/components/switch-7ae55d89.js +0 -121
  135. package/_internal/components/switch-7ae55d89.js.map +0 -1
  136. package/_internal/components/table-5bdf4aec.js +0 -297
  137. package/_internal/components/table-5bdf4aec.js.map +0 -1
  138. package/_internal/components/tabs-2ad54592.js +0 -298
  139. package/_internal/components/tabs-2ad54592.js.map +0 -1
  140. package/_internal/components/text-09c81111.js +0 -2
  141. package/_internal/components/text-09c81111.js.map +0 -1
  142. package/_internal/components/text-field-3e1030f0.js +0 -359
  143. package/_internal/components/text-field-3e1030f0.js.map +0 -1
  144. package/_internal/components/thumbnail-1c5828b9.js +0 -42
  145. package/_internal/components/thumbnail-1c5828b9.js.map +0 -1
  146. package/_internal/components/toolbar-0d14efb7.js +0 -61
  147. package/_internal/components/toolbar-0d14efb7.js.map +0 -1
  148. package/_internal/components/tooltip-31181a24.js +0 -327
  149. package/_internal/components/tooltip-31181a24.js.map +0 -1
  150. package/_internal/components/uploader-845b2412.js +0 -153
  151. package/_internal/components/uploader-845b2412.js.map +0 -1
  152. package/_internal/components/user-block-91c30797.js +0 -144
  153. package/_internal/components/user-block-91c30797.js.map +0 -1
  154. package/_internal/constants-9b714e31.js +0 -2167
  155. package/_internal/constants-9b714e31.js.map +0 -1
  156. package/_internal/constants-d0e3f49e.js +0 -24
  157. package/_internal/constants-d0e3f49e.js.map +0 -1
  158. package/_internal/context-9d1336a1.js +0 -19
  159. package/_internal/context-9d1336a1.js.map +0 -1
  160. package/_internal/forwardRef-d0e90329.js +0 -82
  161. package/_internal/forwardRef-d0e90329.js.map +0 -1
  162. package/_internal/getFocusableElements-230173a8.js +0 -13
  163. package/_internal/getFocusableElements-230173a8.js.map +0 -1
  164. package/_internal/index-68e1b0af.js +0 -436
  165. package/_internal/index-68e1b0af.js.map +0 -1
  166. package/_internal/index-745f94ee.js +0 -103
  167. package/_internal/index-745f94ee.js.map +0 -1
  168. package/_internal/index-ab520e78.js +0 -117
  169. package/_internal/index-ab520e78.js.map +0 -1
  170. package/_internal/information-49bbeed3.js +0 -6
  171. package/_internal/information-49bbeed3.js.map +0 -1
  172. package/_internal/isComponent-b9762ff1.js +0 -18
  173. package/_internal/isComponent-b9762ff1.js.map +0 -1
  174. package/_internal/isComponentType-e806b848.js +0 -9
  175. package/_internal/isComponentType-e806b848.js.map +0 -1
  176. package/_internal/mergeRefs-f0d7d6ea.js +0 -30
  177. package/_internal/mergeRefs-f0d7d6ea.js.map +0 -1
  178. package/_internal/state-db358714.js +0 -130
  179. package/_internal/state-db358714.js.map +0 -1
  180. package/_internal/useBooleanState-2a3d237c.js +0 -12
  181. package/_internal/useBooleanState-2a3d237c.js.map +0 -1
  182. package/_internal/useCallbackOnEscape-0b220f9c.js +0 -62
  183. package/_internal/useCallbackOnEscape-0b220f9c.js.map +0 -1
  184. package/_internal/useDisableBodyScroll-36bd7352.js +0 -219
  185. package/_internal/useDisableBodyScroll-36bd7352.js.map +0 -1
  186. package/_internal/useDisableStateProps-69e16b7c.js +0 -36
  187. package/_internal/useDisableStateProps-69e16b7c.js.map +0 -1
  188. package/_internal/useFocusTrap-3114e5e8.js +0 -112
  189. package/_internal/useFocusTrap-3114e5e8.js.map +0 -1
  190. package/_internal/useId-3a1facc0.js +0 -18
  191. package/_internal/useId-3a1facc0.js.map +0 -1
  192. package/_internal/useRovingTabIndex-7daf0f24.js +0 -77
  193. package/_internal/useRovingTabIndex-7daf0f24.js.map +0 -1
  194. package/_internal/useTransitionVisibility-321fdbfa.js +0 -50
  195. package/_internal/useTransitionVisibility-321fdbfa.js.map +0 -1
  196. package/_internal/wrapChildrenIconWithSpaces-e6038f72.js +0 -20
  197. package/_internal/wrapChildrenIconWithSpaces-e6038f72.js.map +0 -1
@@ -1,2167 +0,0 @@
1
- import * as React from 'react';
2
- import { g as getDefaultExportFromCjs } from './forwardRef-d0e90329.js';
3
- import { I as IS_BROWSER } from './constants-d0e3f49e.js';
4
-
5
- var top = 'top';
6
- var bottom = 'bottom';
7
- var right = 'right';
8
- var left = 'left';
9
- var auto = 'auto';
10
- var basePlacements = [top, bottom, right, left];
11
- var start = 'start';
12
- var end = 'end';
13
- var clippingParents = 'clippingParents';
14
- var viewport = 'viewport';
15
- var popper = 'popper';
16
- var reference = 'reference';
17
- var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {
18
- return acc.concat([placement + "-" + start, placement + "-" + end]);
19
- }, []);
20
- var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {
21
- return acc.concat([placement, placement + "-" + start, placement + "-" + end]);
22
- }, []); // modifiers that need to read the DOM
23
-
24
- var beforeRead = 'beforeRead';
25
- var read = 'read';
26
- var afterRead = 'afterRead'; // pure-logic modifiers
27
-
28
- var beforeMain = 'beforeMain';
29
- var main = 'main';
30
- var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)
31
-
32
- var beforeWrite = 'beforeWrite';
33
- var write = 'write';
34
- var afterWrite = 'afterWrite';
35
- var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
36
-
37
- function getNodeName(element) {
38
- return element ? (element.nodeName || '').toLowerCase() : null;
39
- }
40
-
41
- /*:: import type { Window } from '../types'; */
42
-
43
- /*:: declare function getWindow(node: Node | Window): Window; */
44
- function getWindow(node) {
45
- if (node.toString() !== '[object Window]') {
46
- var ownerDocument = node.ownerDocument;
47
- return ownerDocument ? ownerDocument.defaultView || window : window;
48
- }
49
-
50
- return node;
51
- }
52
-
53
- /*:: declare function isElement(node: mixed): boolean %checks(node instanceof
54
- Element); */
55
-
56
- function isElement(node) {
57
- var OwnElement = getWindow(node).Element;
58
- return node instanceof OwnElement || node instanceof Element;
59
- }
60
- /*:: declare function isHTMLElement(node: mixed): boolean %checks(node instanceof
61
- HTMLElement); */
62
-
63
-
64
- function isHTMLElement(node) {
65
- var OwnElement = getWindow(node).HTMLElement;
66
- return node instanceof OwnElement || node instanceof HTMLElement;
67
- }
68
- /*:: declare function isShadowRoot(node: mixed): boolean %checks(node instanceof
69
- ShadowRoot); */
70
-
71
-
72
- function isShadowRoot(node) {
73
- var OwnElement = getWindow(node).ShadowRoot;
74
- return node instanceof OwnElement || node instanceof ShadowRoot;
75
- }
76
-
77
- // and applies them to the HTMLElements such as popper and arrow
78
-
79
- function applyStyles(_ref) {
80
- var state = _ref.state;
81
- Object.keys(state.elements).forEach(function (name) {
82
- var style = state.styles[name] || {};
83
- var attributes = state.attributes[name] || {};
84
- var element = state.elements[name]; // arrow is optional + virtual elements
85
-
86
- if (!isHTMLElement(element) || !getNodeName(element)) {
87
- return;
88
- } // Flow doesn't support to extend this property, but it's the most
89
- // effective way to apply styles to an HTMLElement
90
- // $FlowFixMe
91
-
92
-
93
- Object.assign(element.style, style);
94
- Object.keys(attributes).forEach(function (name) {
95
- var value = attributes[name];
96
-
97
- if (value === false) {
98
- element.removeAttribute(name);
99
- } else {
100
- element.setAttribute(name, value === true ? '' : value);
101
- }
102
- });
103
- });
104
- }
105
-
106
- function effect$2(_ref2) {
107
- var state = _ref2.state;
108
- var initialStyles = {
109
- popper: {
110
- position: state.options.strategy,
111
- left: '0',
112
- top: '0',
113
- margin: '0'
114
- },
115
- arrow: {
116
- position: 'absolute'
117
- },
118
- reference: {}
119
- };
120
- Object.assign(state.elements.popper.style, initialStyles.popper);
121
-
122
- if (state.elements.arrow) {
123
- Object.assign(state.elements.arrow.style, initialStyles.arrow);
124
- }
125
-
126
- return function () {
127
- Object.keys(state.elements).forEach(function (name) {
128
- var element = state.elements[name];
129
- var attributes = state.attributes[name] || {};
130
- var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them
131
-
132
- var style = styleProperties.reduce(function (style, property) {
133
- style[property] = '';
134
- return style;
135
- }, {}); // arrow is optional + virtual elements
136
-
137
- if (!isHTMLElement(element) || !getNodeName(element)) {
138
- return;
139
- } // Flow doesn't support to extend this property, but it's the most
140
- // effective way to apply styles to an HTMLElement
141
- // $FlowFixMe
142
-
143
-
144
- Object.assign(element.style, style);
145
- Object.keys(attributes).forEach(function (attribute) {
146
- element.removeAttribute(attribute);
147
- });
148
- });
149
- };
150
- } // eslint-disable-next-line import/no-unused-modules
151
-
152
-
153
- var applyStyles$1 = {
154
- name: 'applyStyles',
155
- enabled: true,
156
- phase: 'write',
157
- fn: applyStyles,
158
- effect: effect$2,
159
- requires: ['computeStyles']
160
- };
161
-
162
- function getBasePlacement(placement) {
163
- return placement.split('-')[0];
164
- }
165
-
166
- // Returns the layout rect of an element relative to its offsetParent. Layout
167
- // means it doesn't take into account transforms.
168
- function getLayoutRect(element) {
169
- return {
170
- x: element.offsetLeft,
171
- y: element.offsetTop,
172
- width: element.offsetWidth,
173
- height: element.offsetHeight
174
- };
175
- }
176
-
177
- function contains(parent, child) {
178
- var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method
179
-
180
- if (parent.contains(child)) {
181
- return true;
182
- } // then fallback to custom implementation with Shadow DOM support
183
- else if (rootNode && isShadowRoot(rootNode)) {
184
- var next = child;
185
-
186
- do {
187
- if (next && parent.isSameNode(next)) {
188
- return true;
189
- } // $FlowFixMe: need a better way to handle this...
190
-
191
-
192
- next = next.parentNode || next.host;
193
- } while (next);
194
- } // Give up, the result is false
195
-
196
-
197
- return false;
198
- }
199
-
200
- function getComputedStyle(element) {
201
- return getWindow(element).getComputedStyle(element);
202
- }
203
-
204
- function isTableElement(element) {
205
- return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;
206
- }
207
-
208
- function getDocumentElement(element) {
209
- // $FlowFixMe: assume body is always available
210
- return ((isElement(element) ? element.ownerDocument : element.document) || window.document).documentElement;
211
- }
212
-
213
- function getParentNode(element) {
214
- if (getNodeName(element) === 'html') {
215
- return element;
216
- }
217
-
218
- return (// $FlowFixMe: this is a quicker (but less type safe) way to save quite some bytes from the bundle
219
- element.assignedSlot || // step into the shadow DOM of the parent of a slotted node
220
- element.parentNode || // DOM Element detected
221
- // $FlowFixMe: need a better way to handle this...
222
- element.host || // ShadowRoot detected
223
- // $FlowFixMe: HTMLElement is a Node
224
- getDocumentElement(element) // fallback
225
-
226
- );
227
- }
228
-
229
- function getTrueOffsetParent(element) {
230
- if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837
231
- getComputedStyle(element).position === 'fixed') {
232
- return null;
233
- }
234
-
235
- var offsetParent = element.offsetParent;
236
-
237
- if (offsetParent) {
238
- var html = getDocumentElement(offsetParent);
239
-
240
- if (getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static' && getComputedStyle(html).position !== 'static') {
241
- return html;
242
- }
243
- }
244
-
245
- return offsetParent;
246
- } // `.offsetParent` reports `null` for fixed elements, while absolute elements
247
- // return the containing block
248
-
249
-
250
- function getContainingBlock(element) {
251
- var currentNode = getParentNode(element);
252
-
253
- while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {
254
- var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that
255
- // create a containing block.
256
-
257
- if (css.transform !== 'none' || css.perspective !== 'none' || css.willChange && css.willChange !== 'auto') {
258
- return currentNode;
259
- } else {
260
- currentNode = currentNode.parentNode;
261
- }
262
- }
263
-
264
- return null;
265
- } // Gets the closest ancestor positioned element. Handles some edge cases,
266
- // such as table ancestors and cross browser bugs.
267
-
268
-
269
- function getOffsetParent(element) {
270
- var window = getWindow(element);
271
- var offsetParent = getTrueOffsetParent(element);
272
-
273
- while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {
274
- offsetParent = getTrueOffsetParent(offsetParent);
275
- }
276
-
277
- if (offsetParent && getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static') {
278
- return window;
279
- }
280
-
281
- return offsetParent || getContainingBlock(element) || window;
282
- }
283
-
284
- function getMainAxisFromPlacement(placement) {
285
- return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';
286
- }
287
-
288
- function within(min, value, max) {
289
- return Math.max(min, Math.min(value, max));
290
- }
291
-
292
- function getFreshSideObject() {
293
- return {
294
- top: 0,
295
- right: 0,
296
- bottom: 0,
297
- left: 0
298
- };
299
- }
300
-
301
- function mergePaddingObject(paddingObject) {
302
- return Object.assign(Object.assign({}, getFreshSideObject()), paddingObject);
303
- }
304
-
305
- function expandToHashMap(value, keys) {
306
- return keys.reduce(function (hashMap, key) {
307
- hashMap[key] = value;
308
- return hashMap;
309
- }, {});
310
- }
311
-
312
- function arrow(_ref) {
313
- var _state$modifiersData$;
314
-
315
- var state = _ref.state,
316
- name = _ref.name;
317
- var arrowElement = state.elements.arrow;
318
- var popperOffsets = state.modifiersData.popperOffsets;
319
- var basePlacement = getBasePlacement(state.placement);
320
- var axis = getMainAxisFromPlacement(basePlacement);
321
- var isVertical = [left, right].indexOf(basePlacement) >= 0;
322
- var len = isVertical ? 'height' : 'width';
323
-
324
- if (!arrowElement || !popperOffsets) {
325
- return;
326
- }
327
-
328
- var paddingObject = state.modifiersData[name + "#persistent"].padding;
329
- var arrowRect = getLayoutRect(arrowElement);
330
- var minProp = axis === 'y' ? top : left;
331
- var maxProp = axis === 'y' ? bottom : right;
332
- var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];
333
- var startDiff = popperOffsets[axis] - state.rects.reference[axis];
334
- var arrowOffsetParent = getOffsetParent(arrowElement);
335
- var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
336
- var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is
337
- // outside of the popper bounds
338
-
339
- var min = paddingObject[minProp];
340
- var max = clientSize - arrowRect[len] - paddingObject[maxProp];
341
- var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;
342
- var offset = within(min, center, max); // Prevents breaking syntax highlighting...
343
-
344
- var axisProp = axis;
345
- state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);
346
- }
347
-
348
- function effect$1(_ref2) {
349
- var state = _ref2.state,
350
- options = _ref2.options,
351
- name = _ref2.name;
352
- var _options$element = options.element,
353
- arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element,
354
- _options$padding = options.padding,
355
- padding = _options$padding === void 0 ? 0 : _options$padding;
356
-
357
- if (arrowElement == null) {
358
- return;
359
- } // CSS selector
360
-
361
-
362
- if (typeof arrowElement === 'string') {
363
- arrowElement = state.elements.popper.querySelector(arrowElement);
364
-
365
- if (!arrowElement) {
366
- return;
367
- }
368
- }
369
-
370
- if (process.env.NODE_ENV !== "production") {
371
- if (!isHTMLElement(arrowElement)) {
372
- console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).', 'To use an SVG arrow, wrap it in an HTMLElement that will be used as', 'the arrow.'].join(' '));
373
- }
374
- }
375
-
376
- if (!contains(state.elements.popper, arrowElement)) {
377
- if (process.env.NODE_ENV !== "production") {
378
- console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper', 'element.'].join(' '));
379
- }
380
-
381
- return;
382
- }
383
-
384
- state.elements.arrow = arrowElement;
385
- state.modifiersData[name + "#persistent"] = {
386
- padding: mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements))
387
- };
388
- } // eslint-disable-next-line import/no-unused-modules
389
-
390
-
391
- var arrow$1 = {
392
- name: 'arrow',
393
- enabled: true,
394
- phase: 'main',
395
- fn: arrow,
396
- effect: effect$1,
397
- requires: ['popperOffsets'],
398
- requiresIfExists: ['preventOverflow']
399
- };
400
-
401
- var unsetSides = {
402
- top: 'auto',
403
- right: 'auto',
404
- bottom: 'auto',
405
- left: 'auto'
406
- }; // Round the offsets to the nearest suitable subpixel based on the DPR.
407
- // Zooming can change the DPR, but it seems to report a value that will
408
- // cleanly divide the values into the appropriate subpixels.
409
-
410
- function roundOffsets(_ref) {
411
- var x = _ref.x,
412
- y = _ref.y;
413
- var win = window;
414
- var dpr = win.devicePixelRatio || 1;
415
- return {
416
- x: Math.round(x * dpr) / dpr || 0,
417
- y: Math.round(y * dpr) / dpr || 0
418
- };
419
- }
420
-
421
- function mapToStyles(_ref2) {
422
- var _Object$assign2;
423
-
424
- var popper = _ref2.popper,
425
- popperRect = _ref2.popperRect,
426
- placement = _ref2.placement,
427
- offsets = _ref2.offsets,
428
- position = _ref2.position,
429
- gpuAcceleration = _ref2.gpuAcceleration,
430
- adaptive = _ref2.adaptive;
431
-
432
- var _roundOffsets = roundOffsets(offsets),
433
- x = _roundOffsets.x,
434
- y = _roundOffsets.y;
435
-
436
- var hasX = offsets.hasOwnProperty('x');
437
- var hasY = offsets.hasOwnProperty('y');
438
- var sideX = left;
439
- var sideY = top;
440
- var win = window;
441
-
442
- if (adaptive) {
443
- var offsetParent = getOffsetParent(popper);
444
-
445
- if (offsetParent === getWindow(popper)) {
446
- offsetParent = getDocumentElement(popper);
447
- } // $FlowFixMe: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it
448
-
449
- /*:: offsetParent = (offsetParent: Element); */
450
-
451
-
452
- if (placement === top) {
453
- sideY = bottom;
454
- y -= offsetParent.clientHeight - popperRect.height;
455
- y *= gpuAcceleration ? 1 : -1;
456
- }
457
-
458
- if (placement === left) {
459
- sideX = right;
460
- x -= offsetParent.clientWidth - popperRect.width;
461
- x *= gpuAcceleration ? 1 : -1;
462
- }
463
- }
464
-
465
- var commonStyles = Object.assign({
466
- position: position
467
- }, adaptive && unsetSides);
468
-
469
- if (gpuAcceleration) {
470
- var _Object$assign;
471
-
472
- return Object.assign(Object.assign({}, commonStyles), {}, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) < 2 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign));
473
- }
474
-
475
- return Object.assign(Object.assign({}, commonStyles), {}, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2));
476
- }
477
-
478
- function computeStyles(_ref3) {
479
- var state = _ref3.state,
480
- options = _ref3.options;
481
- var _options$gpuAccelerat = options.gpuAcceleration,
482
- gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,
483
- _options$adaptive = options.adaptive,
484
- adaptive = _options$adaptive === void 0 ? true : _options$adaptive;
485
-
486
- if (process.env.NODE_ENV !== "production") {
487
- var transitionProperty = getComputedStyle(state.elements.popper).transitionProperty || '';
488
-
489
- if (adaptive && ['transform', 'top', 'right', 'bottom', 'left'].some(function (property) {
490
- return transitionProperty.indexOf(property) >= 0;
491
- })) {
492
- console.warn(['Popper: Detected CSS transitions on at least one of the following', 'CSS properties: "transform", "top", "right", "bottom", "left".', '\n\n', 'Disable the "computeStyles" modifier\'s `adaptive` option to allow', 'for smooth transitions, or remove these properties from the CSS', 'transition declaration on the popper element if only transitioning', 'opacity or background-color for example.', '\n\n', 'We recommend using the popper element as a wrapper around an inner', 'element that can have any CSS property transitioned for animations.'].join(' '));
493
- }
494
- }
495
-
496
- var commonStyles = {
497
- placement: getBasePlacement(state.placement),
498
- popper: state.elements.popper,
499
- popperRect: state.rects.popper,
500
- gpuAcceleration: gpuAcceleration
501
- };
502
-
503
- if (state.modifiersData.popperOffsets != null) {
504
- state.styles.popper = Object.assign(Object.assign({}, state.styles.popper), mapToStyles(Object.assign(Object.assign({}, commonStyles), {}, {
505
- offsets: state.modifiersData.popperOffsets,
506
- position: state.options.strategy,
507
- adaptive: adaptive
508
- })));
509
- }
510
-
511
- if (state.modifiersData.arrow != null) {
512
- state.styles.arrow = Object.assign(Object.assign({}, state.styles.arrow), mapToStyles(Object.assign(Object.assign({}, commonStyles), {}, {
513
- offsets: state.modifiersData.arrow,
514
- position: 'absolute',
515
- adaptive: false
516
- })));
517
- }
518
-
519
- state.attributes.popper = Object.assign(Object.assign({}, state.attributes.popper), {}, {
520
- 'data-popper-placement': state.placement
521
- });
522
- } // eslint-disable-next-line import/no-unused-modules
523
-
524
-
525
- var computeStyles$1 = {
526
- name: 'computeStyles',
527
- enabled: true,
528
- phase: 'beforeWrite',
529
- fn: computeStyles,
530
- data: {}
531
- };
532
-
533
- var passive = {
534
- passive: true
535
- };
536
-
537
- function effect(_ref) {
538
- var state = _ref.state,
539
- instance = _ref.instance,
540
- options = _ref.options;
541
- var _options$scroll = options.scroll,
542
- scroll = _options$scroll === void 0 ? true : _options$scroll,
543
- _options$resize = options.resize,
544
- resize = _options$resize === void 0 ? true : _options$resize;
545
- var window = getWindow(state.elements.popper);
546
- var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);
547
-
548
- if (scroll) {
549
- scrollParents.forEach(function (scrollParent) {
550
- scrollParent.addEventListener('scroll', instance.update, passive);
551
- });
552
- }
553
-
554
- if (resize) {
555
- window.addEventListener('resize', instance.update, passive);
556
- }
557
-
558
- return function () {
559
- if (scroll) {
560
- scrollParents.forEach(function (scrollParent) {
561
- scrollParent.removeEventListener('scroll', instance.update, passive);
562
- });
563
- }
564
-
565
- if (resize) {
566
- window.removeEventListener('resize', instance.update, passive);
567
- }
568
- };
569
- } // eslint-disable-next-line import/no-unused-modules
570
-
571
-
572
- var eventListeners = {
573
- name: 'eventListeners',
574
- enabled: true,
575
- phase: 'write',
576
- fn: function fn() {},
577
- effect: effect,
578
- data: {}
579
- };
580
-
581
- var hash$1 = {
582
- left: 'right',
583
- right: 'left',
584
- bottom: 'top',
585
- top: 'bottom'
586
- };
587
- function getOppositePlacement(placement) {
588
- return placement.replace(/left|right|bottom|top/g, function (matched) {
589
- return hash$1[matched];
590
- });
591
- }
592
-
593
- var hash = {
594
- start: 'end',
595
- end: 'start'
596
- };
597
- function getOppositeVariationPlacement(placement) {
598
- return placement.replace(/start|end/g, function (matched) {
599
- return hash[matched];
600
- });
601
- }
602
-
603
- function getBoundingClientRect(element) {
604
- var rect = element.getBoundingClientRect();
605
- return {
606
- width: rect.width,
607
- height: rect.height,
608
- top: rect.top,
609
- right: rect.right,
610
- bottom: rect.bottom,
611
- left: rect.left,
612
- x: rect.left,
613
- y: rect.top
614
- };
615
- }
616
-
617
- function getWindowScroll(node) {
618
- var win = getWindow(node);
619
- var scrollLeft = win.pageXOffset;
620
- var scrollTop = win.pageYOffset;
621
- return {
622
- scrollLeft: scrollLeft,
623
- scrollTop: scrollTop
624
- };
625
- }
626
-
627
- function getWindowScrollBarX(element) {
628
- // If <html> has a CSS width greater than the viewport, then this will be
629
- // incorrect for RTL.
630
- // Popper 1 is broken in this case and never had a bug report so let's assume
631
- // it's not an issue. I don't think anyone ever specifies width on <html>
632
- // anyway.
633
- // Browsers where the left scrollbar doesn't cause an issue report `0` for
634
- // this (e.g. Edge 2019, IE11, Safari)
635
- return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
636
- }
637
-
638
- function getViewportRect(element) {
639
- var win = getWindow(element);
640
- var html = getDocumentElement(element);
641
- var visualViewport = win.visualViewport;
642
- var width = html.clientWidth;
643
- var height = html.clientHeight;
644
- var x = 0;
645
- var y = 0; // NB: This isn't supported on iOS <= 12. If the keyboard is open, the popper
646
- // can be obscured underneath it.
647
- // Also, `html.clientHeight` adds the bottom bar height in Safari iOS, even
648
- // if it isn't open, so if this isn't available, the popper will be detected
649
- // to overflow the bottom of the screen too early.
650
-
651
- if (visualViewport) {
652
- width = visualViewport.width;
653
- height = visualViewport.height; // Uses Layout Viewport (like Chrome; Safari does not currently)
654
- // In Chrome, it returns a value very close to 0 (+/-) but contains rounding
655
- // errors due to floating point numbers, so we need to check precision.
656
- // Safari returns a number <= 0, usually < -1 when pinch-zoomed
657
- // Feature detection fails in mobile emulation mode in Chrome.
658
- // Math.abs(win.innerWidth / visualViewport.scale - visualViewport.width) <
659
- // 0.001
660
- // Fallback here: "Not Safari" userAgent
661
-
662
- if (!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {
663
- x = visualViewport.offsetLeft;
664
- y = visualViewport.offsetTop;
665
- }
666
- }
667
-
668
- return {
669
- width: width,
670
- height: height,
671
- x: x + getWindowScrollBarX(element),
672
- y: y
673
- };
674
- }
675
-
676
- // of the `<html>` and `<body>` rect bounds if horizontally scrollable
677
-
678
- function getDocumentRect(element) {
679
- var html = getDocumentElement(element);
680
- var winScroll = getWindowScroll(element);
681
- var body = element.ownerDocument.body;
682
- var width = Math.max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
683
- var height = Math.max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
684
- var x = -winScroll.scrollLeft + getWindowScrollBarX(element);
685
- var y = -winScroll.scrollTop;
686
-
687
- if (getComputedStyle(body || html).direction === 'rtl') {
688
- x += Math.max(html.clientWidth, body ? body.clientWidth : 0) - width;
689
- }
690
-
691
- return {
692
- width: width,
693
- height: height,
694
- x: x,
695
- y: y
696
- };
697
- }
698
-
699
- function isScrollParent(element) {
700
- // Firefox wants us to check `-x` and `-y` variations as well
701
- var _getComputedStyle = getComputedStyle(element),
702
- overflow = _getComputedStyle.overflow,
703
- overflowX = _getComputedStyle.overflowX,
704
- overflowY = _getComputedStyle.overflowY;
705
-
706
- return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
707
- }
708
-
709
- function getScrollParent(node) {
710
- if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {
711
- // $FlowFixMe: assume body is always available
712
- return node.ownerDocument.body;
713
- }
714
-
715
- if (isHTMLElement(node) && isScrollParent(node)) {
716
- return node;
717
- }
718
-
719
- return getScrollParent(getParentNode(node));
720
- }
721
-
722
- /*
723
- given a DOM element, return the list of all scroll parents, up the list of ancesors
724
- until we get to the top window object. This list is what we attach scroll listeners
725
- to, because if any of these parent elements scroll, we'll need to re-calculate the
726
- reference element's position.
727
- */
728
-
729
- function listScrollParents(element, list) {
730
- if (list === void 0) {
731
- list = [];
732
- }
733
-
734
- var scrollParent = getScrollParent(element);
735
- var isBody = getNodeName(scrollParent) === 'body';
736
- var win = getWindow(scrollParent);
737
- var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
738
- var updatedList = list.concat(target);
739
- return isBody ? updatedList : // $FlowFixMe: isBody tells us target will be an HTMLElement here
740
- updatedList.concat(listScrollParents(getParentNode(target)));
741
- }
742
-
743
- function rectToClientRect(rect) {
744
- return Object.assign(Object.assign({}, rect), {}, {
745
- left: rect.x,
746
- top: rect.y,
747
- right: rect.x + rect.width,
748
- bottom: rect.y + rect.height
749
- });
750
- }
751
-
752
- function getInnerBoundingClientRect(element) {
753
- var rect = getBoundingClientRect(element);
754
- rect.top = rect.top + element.clientTop;
755
- rect.left = rect.left + element.clientLeft;
756
- rect.bottom = rect.top + element.clientHeight;
757
- rect.right = rect.left + element.clientWidth;
758
- rect.width = element.clientWidth;
759
- rect.height = element.clientHeight;
760
- rect.x = rect.left;
761
- rect.y = rect.top;
762
- return rect;
763
- }
764
-
765
- function getClientRectFromMixedType(element, clippingParent) {
766
- return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isHTMLElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
767
- } // A "clipping parent" is an overflowable container with the characteristic of
768
- // clipping (or hiding) overflowing elements with a position different from
769
- // `initial`
770
-
771
-
772
- function getClippingParents(element) {
773
- var clippingParents = listScrollParents(getParentNode(element));
774
- var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;
775
- var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
776
-
777
- if (!isElement(clipperElement)) {
778
- return [];
779
- } // $FlowFixMe: https://github.com/facebook/flow/issues/1414
780
-
781
-
782
- return clippingParents.filter(function (clippingParent) {
783
- return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';
784
- });
785
- } // Gets the maximum area that the element is visible in due to any number of
786
- // clipping parents
787
-
788
-
789
- function getClippingRect(element, boundary, rootBoundary) {
790
- var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);
791
- var clippingParents = [].concat(mainClippingParents, [rootBoundary]);
792
- var firstClippingParent = clippingParents[0];
793
- var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {
794
- var rect = getClientRectFromMixedType(element, clippingParent);
795
- accRect.top = Math.max(rect.top, accRect.top);
796
- accRect.right = Math.min(rect.right, accRect.right);
797
- accRect.bottom = Math.min(rect.bottom, accRect.bottom);
798
- accRect.left = Math.max(rect.left, accRect.left);
799
- return accRect;
800
- }, getClientRectFromMixedType(element, firstClippingParent));
801
- clippingRect.width = clippingRect.right - clippingRect.left;
802
- clippingRect.height = clippingRect.bottom - clippingRect.top;
803
- clippingRect.x = clippingRect.left;
804
- clippingRect.y = clippingRect.top;
805
- return clippingRect;
806
- }
807
-
808
- function getVariation(placement) {
809
- return placement.split('-')[1];
810
- }
811
-
812
- function computeOffsets(_ref) {
813
- var reference = _ref.reference,
814
- element = _ref.element,
815
- placement = _ref.placement;
816
- var basePlacement = placement ? getBasePlacement(placement) : null;
817
- var variation = placement ? getVariation(placement) : null;
818
- var commonX = reference.x + reference.width / 2 - element.width / 2;
819
- var commonY = reference.y + reference.height / 2 - element.height / 2;
820
- var offsets;
821
-
822
- switch (basePlacement) {
823
- case top:
824
- offsets = {
825
- x: commonX,
826
- y: reference.y - element.height
827
- };
828
- break;
829
-
830
- case bottom:
831
- offsets = {
832
- x: commonX,
833
- y: reference.y + reference.height
834
- };
835
- break;
836
-
837
- case right:
838
- offsets = {
839
- x: reference.x + reference.width,
840
- y: commonY
841
- };
842
- break;
843
-
844
- case left:
845
- offsets = {
846
- x: reference.x - element.width,
847
- y: commonY
848
- };
849
- break;
850
-
851
- default:
852
- offsets = {
853
- x: reference.x,
854
- y: reference.y
855
- };
856
- }
857
-
858
- var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;
859
-
860
- if (mainAxis != null) {
861
- var len = mainAxis === 'y' ? 'height' : 'width';
862
-
863
- switch (variation) {
864
- case start:
865
- offsets[mainAxis] = Math.floor(offsets[mainAxis]) - Math.floor(reference[len] / 2 - element[len] / 2);
866
- break;
867
-
868
- case end:
869
- offsets[mainAxis] = Math.floor(offsets[mainAxis]) + Math.ceil(reference[len] / 2 - element[len] / 2);
870
- break;
871
- }
872
- }
873
-
874
- return offsets;
875
- }
876
-
877
- function detectOverflow(state, options) {
878
- if (options === void 0) {
879
- options = {};
880
- }
881
-
882
- var _options = options,
883
- _options$placement = _options.placement,
884
- placement = _options$placement === void 0 ? state.placement : _options$placement,
885
- _options$boundary = _options.boundary,
886
- boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,
887
- _options$rootBoundary = _options.rootBoundary,
888
- rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,
889
- _options$elementConte = _options.elementContext,
890
- elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,
891
- _options$altBoundary = _options.altBoundary,
892
- altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,
893
- _options$padding = _options.padding,
894
- padding = _options$padding === void 0 ? 0 : _options$padding;
895
- var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
896
- var altContext = elementContext === popper ? reference : popper;
897
- var referenceElement = state.elements.reference;
898
- var popperRect = state.rects.popper;
899
- var element = state.elements[altBoundary ? altContext : elementContext];
900
- var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary);
901
- var referenceClientRect = getBoundingClientRect(referenceElement);
902
- var popperOffsets = computeOffsets({
903
- reference: referenceClientRect,
904
- element: popperRect,
905
- strategy: 'absolute',
906
- placement: placement
907
- });
908
- var popperClientRect = rectToClientRect(Object.assign(Object.assign({}, popperRect), popperOffsets));
909
- var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect
910
- // 0 or negative = within the clipping rect
911
-
912
- var overflowOffsets = {
913
- top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
914
- bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
915
- left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
916
- right: elementClientRect.right - clippingClientRect.right + paddingObject.right
917
- };
918
- var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element
919
-
920
- if (elementContext === popper && offsetData) {
921
- var offset = offsetData[placement];
922
- Object.keys(overflowOffsets).forEach(function (key) {
923
- var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;
924
- var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';
925
- overflowOffsets[key] += offset[axis] * multiply;
926
- });
927
- }
928
-
929
- return overflowOffsets;
930
- }
931
-
932
- /*:: type OverflowsMap = { [ComputedPlacement]: number }; */
933
-
934
- /*;; type OverflowsMap = { [key in ComputedPlacement]: number }; */
935
- function computeAutoPlacement(state, options) {
936
- if (options === void 0) {
937
- options = {};
938
- }
939
-
940
- var _options = options,
941
- placement = _options.placement,
942
- boundary = _options.boundary,
943
- rootBoundary = _options.rootBoundary,
944
- padding = _options.padding,
945
- flipVariations = _options.flipVariations,
946
- _options$allowedAutoP = _options.allowedAutoPlacements,
947
- allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP;
948
- var variation = getVariation(placement);
949
- var placements$1 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {
950
- return getVariation(placement) === variation;
951
- }) : basePlacements; // $FlowFixMe
952
-
953
- var allowedPlacements = placements$1.filter(function (placement) {
954
- return allowedAutoPlacements.indexOf(placement) >= 0;
955
- });
956
-
957
- if (allowedPlacements.length === 0) {
958
- allowedPlacements = placements$1;
959
-
960
- if (process.env.NODE_ENV !== "production") {
961
- console.error(['Popper: The `allowedAutoPlacements` option did not allow any', 'placements. Ensure the `placement` option matches the variation', 'of the allowed placements.', 'For example, "auto" cannot be used to allow "bottom-start".', 'Use "auto-start" instead.'].join(' '));
962
- }
963
- } // $FlowFixMe: Flow seems to have problems with two array unions...
964
-
965
-
966
- var overflows = allowedPlacements.reduce(function (acc, placement) {
967
- acc[placement] = detectOverflow(state, {
968
- placement: placement,
969
- boundary: boundary,
970
- rootBoundary: rootBoundary,
971
- padding: padding
972
- })[getBasePlacement(placement)];
973
- return acc;
974
- }, {});
975
- return Object.keys(overflows).sort(function (a, b) {
976
- return overflows[a] - overflows[b];
977
- });
978
- }
979
-
980
- function getExpandedFallbackPlacements(placement) {
981
- if (getBasePlacement(placement) === auto) {
982
- return [];
983
- }
984
-
985
- var oppositePlacement = getOppositePlacement(placement);
986
- return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];
987
- }
988
-
989
- function flip(_ref) {
990
- var state = _ref.state,
991
- options = _ref.options,
992
- name = _ref.name;
993
-
994
- if (state.modifiersData[name]._skip) {
995
- return;
996
- }
997
-
998
- var _options$mainAxis = options.mainAxis,
999
- checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
1000
- _options$altAxis = options.altAxis,
1001
- checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,
1002
- specifiedFallbackPlacements = options.fallbackPlacements,
1003
- padding = options.padding,
1004
- boundary = options.boundary,
1005
- rootBoundary = options.rootBoundary,
1006
- altBoundary = options.altBoundary,
1007
- _options$flipVariatio = options.flipVariations,
1008
- flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,
1009
- allowedAutoPlacements = options.allowedAutoPlacements;
1010
- var preferredPlacement = state.options.placement;
1011
- var basePlacement = getBasePlacement(preferredPlacement);
1012
- var isBasePlacement = basePlacement === preferredPlacement;
1013
- var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));
1014
- var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {
1015
- return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {
1016
- placement: placement,
1017
- boundary: boundary,
1018
- rootBoundary: rootBoundary,
1019
- padding: padding,
1020
- flipVariations: flipVariations,
1021
- allowedAutoPlacements: allowedAutoPlacements
1022
- }) : placement);
1023
- }, []);
1024
- var referenceRect = state.rects.reference;
1025
- var popperRect = state.rects.popper;
1026
- var checksMap = new Map();
1027
- var makeFallbackChecks = true;
1028
- var firstFittingPlacement = placements[0];
1029
-
1030
- for (var i = 0; i < placements.length; i++) {
1031
- var placement = placements[i];
1032
-
1033
- var _basePlacement = getBasePlacement(placement);
1034
-
1035
- var isStartVariation = getVariation(placement) === start;
1036
- var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;
1037
- var len = isVertical ? 'width' : 'height';
1038
- var overflow = detectOverflow(state, {
1039
- placement: placement,
1040
- boundary: boundary,
1041
- rootBoundary: rootBoundary,
1042
- altBoundary: altBoundary,
1043
- padding: padding
1044
- });
1045
- var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;
1046
-
1047
- if (referenceRect[len] > popperRect[len]) {
1048
- mainVariationSide = getOppositePlacement(mainVariationSide);
1049
- }
1050
-
1051
- var altVariationSide = getOppositePlacement(mainVariationSide);
1052
- var checks = [];
1053
-
1054
- if (checkMainAxis) {
1055
- checks.push(overflow[_basePlacement] <= 0);
1056
- }
1057
-
1058
- if (checkAltAxis) {
1059
- checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);
1060
- }
1061
-
1062
- if (checks.every(function (check) {
1063
- return check;
1064
- })) {
1065
- firstFittingPlacement = placement;
1066
- makeFallbackChecks = false;
1067
- break;
1068
- }
1069
-
1070
- checksMap.set(placement, checks);
1071
- }
1072
-
1073
- if (makeFallbackChecks) {
1074
- // `2` may be desired in some cases – research later
1075
- var numberOfChecks = flipVariations ? 3 : 1;
1076
-
1077
- var _loop = function _loop(_i) {
1078
- var fittingPlacement = placements.find(function (placement) {
1079
- var checks = checksMap.get(placement);
1080
-
1081
- if (checks) {
1082
- return checks.slice(0, _i).every(function (check) {
1083
- return check;
1084
- });
1085
- }
1086
- });
1087
-
1088
- if (fittingPlacement) {
1089
- firstFittingPlacement = fittingPlacement;
1090
- return "break";
1091
- }
1092
- };
1093
-
1094
- for (var _i = numberOfChecks; _i > 0; _i--) {
1095
- var _ret = _loop(_i);
1096
-
1097
- if (_ret === "break") break;
1098
- }
1099
- }
1100
-
1101
- if (state.placement !== firstFittingPlacement) {
1102
- state.modifiersData[name]._skip = true;
1103
- state.placement = firstFittingPlacement;
1104
- state.reset = true;
1105
- }
1106
- } // eslint-disable-next-line import/no-unused-modules
1107
-
1108
-
1109
- var flip$1 = {
1110
- name: 'flip',
1111
- enabled: true,
1112
- phase: 'main',
1113
- fn: flip,
1114
- requiresIfExists: ['offset'],
1115
- data: {
1116
- _skip: false
1117
- }
1118
- };
1119
-
1120
- function getSideOffsets(overflow, rect, preventedOffsets) {
1121
- if (preventedOffsets === void 0) {
1122
- preventedOffsets = {
1123
- x: 0,
1124
- y: 0
1125
- };
1126
- }
1127
-
1128
- return {
1129
- top: overflow.top - rect.height - preventedOffsets.y,
1130
- right: overflow.right - rect.width + preventedOffsets.x,
1131
- bottom: overflow.bottom - rect.height + preventedOffsets.y,
1132
- left: overflow.left - rect.width - preventedOffsets.x
1133
- };
1134
- }
1135
-
1136
- function isAnySideFullyClipped(overflow) {
1137
- return [top, right, bottom, left].some(function (side) {
1138
- return overflow[side] >= 0;
1139
- });
1140
- }
1141
-
1142
- function hide(_ref) {
1143
- var state = _ref.state,
1144
- name = _ref.name;
1145
- var referenceRect = state.rects.reference;
1146
- var popperRect = state.rects.popper;
1147
- var preventedOffsets = state.modifiersData.preventOverflow;
1148
- var referenceOverflow = detectOverflow(state, {
1149
- elementContext: 'reference'
1150
- });
1151
- var popperAltOverflow = detectOverflow(state, {
1152
- altBoundary: true
1153
- });
1154
- var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);
1155
- var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);
1156
- var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);
1157
- var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);
1158
- state.modifiersData[name] = {
1159
- referenceClippingOffsets: referenceClippingOffsets,
1160
- popperEscapeOffsets: popperEscapeOffsets,
1161
- isReferenceHidden: isReferenceHidden,
1162
- hasPopperEscaped: hasPopperEscaped
1163
- };
1164
- state.attributes.popper = Object.assign(Object.assign({}, state.attributes.popper), {}, {
1165
- 'data-popper-reference-hidden': isReferenceHidden,
1166
- 'data-popper-escaped': hasPopperEscaped
1167
- });
1168
- } // eslint-disable-next-line import/no-unused-modules
1169
-
1170
-
1171
- var hide$1 = {
1172
- name: 'hide',
1173
- enabled: true,
1174
- phase: 'main',
1175
- requiresIfExists: ['preventOverflow'],
1176
- fn: hide
1177
- };
1178
-
1179
- function distanceAndSkiddingToXY(placement, rects, offset) {
1180
- var basePlacement = getBasePlacement(placement);
1181
- var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;
1182
-
1183
- var _ref = typeof offset === 'function' ? offset(Object.assign(Object.assign({}, rects), {}, {
1184
- placement: placement
1185
- })) : offset,
1186
- skidding = _ref[0],
1187
- distance = _ref[1];
1188
-
1189
- skidding = skidding || 0;
1190
- distance = (distance || 0) * invertDistance;
1191
- return [left, right].indexOf(basePlacement) >= 0 ? {
1192
- x: distance,
1193
- y: skidding
1194
- } : {
1195
- x: skidding,
1196
- y: distance
1197
- };
1198
- }
1199
-
1200
- function offset(_ref2) {
1201
- var state = _ref2.state,
1202
- options = _ref2.options,
1203
- name = _ref2.name;
1204
- var _options$offset = options.offset,
1205
- offset = _options$offset === void 0 ? [0, 0] : _options$offset;
1206
- var data = placements.reduce(function (acc, placement) {
1207
- acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);
1208
- return acc;
1209
- }, {});
1210
- var _data$state$placement = data[state.placement],
1211
- x = _data$state$placement.x,
1212
- y = _data$state$placement.y;
1213
-
1214
- if (state.modifiersData.popperOffsets != null) {
1215
- state.modifiersData.popperOffsets.x += x;
1216
- state.modifiersData.popperOffsets.y += y;
1217
- }
1218
-
1219
- state.modifiersData[name] = data;
1220
- } // eslint-disable-next-line import/no-unused-modules
1221
-
1222
-
1223
- var offset$1 = {
1224
- name: 'offset',
1225
- enabled: true,
1226
- phase: 'main',
1227
- requires: ['popperOffsets'],
1228
- fn: offset
1229
- };
1230
-
1231
- function popperOffsets(_ref) {
1232
- var state = _ref.state,
1233
- name = _ref.name;
1234
- // Offsets are the actual position the popper needs to have to be
1235
- // properly positioned near its reference element
1236
- // This is the most basic placement, and will be adjusted by
1237
- // the modifiers in the next step
1238
- state.modifiersData[name] = computeOffsets({
1239
- reference: state.rects.reference,
1240
- element: state.rects.popper,
1241
- strategy: 'absolute',
1242
- placement: state.placement
1243
- });
1244
- } // eslint-disable-next-line import/no-unused-modules
1245
-
1246
-
1247
- var popperOffsets$1 = {
1248
- name: 'popperOffsets',
1249
- enabled: true,
1250
- phase: 'read',
1251
- fn: popperOffsets,
1252
- data: {}
1253
- };
1254
-
1255
- function getAltAxis(axis) {
1256
- return axis === 'x' ? 'y' : 'x';
1257
- }
1258
-
1259
- function preventOverflow(_ref) {
1260
- var state = _ref.state,
1261
- options = _ref.options,
1262
- name = _ref.name;
1263
- var _options$mainAxis = options.mainAxis,
1264
- checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
1265
- _options$altAxis = options.altAxis,
1266
- checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,
1267
- boundary = options.boundary,
1268
- rootBoundary = options.rootBoundary,
1269
- altBoundary = options.altBoundary,
1270
- padding = options.padding,
1271
- _options$tether = options.tether,
1272
- tether = _options$tether === void 0 ? true : _options$tether,
1273
- _options$tetherOffset = options.tetherOffset,
1274
- tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;
1275
- var overflow = detectOverflow(state, {
1276
- boundary: boundary,
1277
- rootBoundary: rootBoundary,
1278
- padding: padding,
1279
- altBoundary: altBoundary
1280
- });
1281
- var basePlacement = getBasePlacement(state.placement);
1282
- var variation = getVariation(state.placement);
1283
- var isBasePlacement = !variation;
1284
- var mainAxis = getMainAxisFromPlacement(basePlacement);
1285
- var altAxis = getAltAxis(mainAxis);
1286
- var popperOffsets = state.modifiersData.popperOffsets;
1287
- var referenceRect = state.rects.reference;
1288
- var popperRect = state.rects.popper;
1289
- var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign(Object.assign({}, state.rects), {}, {
1290
- placement: state.placement
1291
- })) : tetherOffset;
1292
- var data = {
1293
- x: 0,
1294
- y: 0
1295
- };
1296
-
1297
- if (!popperOffsets) {
1298
- return;
1299
- }
1300
-
1301
- if (checkMainAxis) {
1302
- var mainSide = mainAxis === 'y' ? top : left;
1303
- var altSide = mainAxis === 'y' ? bottom : right;
1304
- var len = mainAxis === 'y' ? 'height' : 'width';
1305
- var offset = popperOffsets[mainAxis];
1306
- var min = popperOffsets[mainAxis] + overflow[mainSide];
1307
- var max = popperOffsets[mainAxis] - overflow[altSide];
1308
- var additive = tether ? -popperRect[len] / 2 : 0;
1309
- var minLen = variation === start ? referenceRect[len] : popperRect[len];
1310
- var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go
1311
- // outside the reference bounds
1312
-
1313
- var arrowElement = state.elements.arrow;
1314
- var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {
1315
- width: 0,
1316
- height: 0
1317
- };
1318
- var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();
1319
- var arrowPaddingMin = arrowPaddingObject[mainSide];
1320
- var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want
1321
- // to include its full size in the calculation. If the reference is small
1322
- // and near the edge of a boundary, the popper can overflow even if the
1323
- // reference is not overflowing as well (e.g. virtual elements with no
1324
- // width or height)
1325
-
1326
- var arrowLen = within(0, referenceRect[len], arrowRect[len]);
1327
- var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - tetherOffsetValue : minLen - arrowLen - arrowPaddingMin - tetherOffsetValue;
1328
- var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + tetherOffsetValue : maxLen + arrowLen + arrowPaddingMax + tetherOffsetValue;
1329
- var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
1330
- var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
1331
- var offsetModifierValue = state.modifiersData.offset ? state.modifiersData.offset[state.placement][mainAxis] : 0;
1332
- var tetherMin = popperOffsets[mainAxis] + minOffset - offsetModifierValue - clientOffset;
1333
- var tetherMax = popperOffsets[mainAxis] + maxOffset - offsetModifierValue;
1334
- var preventedOffset = within(tether ? Math.min(min, tetherMin) : min, offset, tether ? Math.max(max, tetherMax) : max);
1335
- popperOffsets[mainAxis] = preventedOffset;
1336
- data[mainAxis] = preventedOffset - offset;
1337
- }
1338
-
1339
- if (checkAltAxis) {
1340
- var _mainSide = mainAxis === 'x' ? top : left;
1341
-
1342
- var _altSide = mainAxis === 'x' ? bottom : right;
1343
-
1344
- var _offset = popperOffsets[altAxis];
1345
-
1346
- var _min = _offset + overflow[_mainSide];
1347
-
1348
- var _max = _offset - overflow[_altSide];
1349
-
1350
- var _preventedOffset = within(_min, _offset, _max);
1351
-
1352
- popperOffsets[altAxis] = _preventedOffset;
1353
- data[altAxis] = _preventedOffset - _offset;
1354
- }
1355
-
1356
- state.modifiersData[name] = data;
1357
- } // eslint-disable-next-line import/no-unused-modules
1358
-
1359
-
1360
- var preventOverflow$1 = {
1361
- name: 'preventOverflow',
1362
- enabled: true,
1363
- phase: 'main',
1364
- fn: preventOverflow,
1365
- requiresIfExists: ['offset']
1366
- };
1367
-
1368
- function getHTMLElementScroll(element) {
1369
- return {
1370
- scrollLeft: element.scrollLeft,
1371
- scrollTop: element.scrollTop
1372
- };
1373
- }
1374
-
1375
- function getNodeScroll(node) {
1376
- if (node === getWindow(node) || !isHTMLElement(node)) {
1377
- return getWindowScroll(node);
1378
- } else {
1379
- return getHTMLElementScroll(node);
1380
- }
1381
- }
1382
-
1383
- // Composite means it takes into account transforms as well as layout.
1384
-
1385
- function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
1386
- if (isFixed === void 0) {
1387
- isFixed = false;
1388
- }
1389
-
1390
- var documentElement = getDocumentElement(offsetParent);
1391
- var rect = getBoundingClientRect(elementOrVirtualElement);
1392
- var isOffsetParentAnElement = isHTMLElement(offsetParent);
1393
- var scroll = {
1394
- scrollLeft: 0,
1395
- scrollTop: 0
1396
- };
1397
- var offsets = {
1398
- x: 0,
1399
- y: 0
1400
- };
1401
-
1402
- if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
1403
- if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078
1404
- isScrollParent(documentElement)) {
1405
- scroll = getNodeScroll(offsetParent);
1406
- }
1407
-
1408
- if (isHTMLElement(offsetParent)) {
1409
- offsets = getBoundingClientRect(offsetParent);
1410
- offsets.x += offsetParent.clientLeft;
1411
- offsets.y += offsetParent.clientTop;
1412
- } else if (documentElement) {
1413
- offsets.x = getWindowScrollBarX(documentElement);
1414
- }
1415
- }
1416
-
1417
- return {
1418
- x: rect.left + scroll.scrollLeft - offsets.x,
1419
- y: rect.top + scroll.scrollTop - offsets.y,
1420
- width: rect.width,
1421
- height: rect.height
1422
- };
1423
- }
1424
-
1425
- function order(modifiers) {
1426
- var map = new Map();
1427
- var visited = new Set();
1428
- var result = [];
1429
- modifiers.forEach(function (modifier) {
1430
- map.set(modifier.name, modifier);
1431
- }); // On visiting object, check for its dependencies and visit them recursively
1432
-
1433
- function sort(modifier) {
1434
- visited.add(modifier.name);
1435
- var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);
1436
- requires.forEach(function (dep) {
1437
- if (!visited.has(dep)) {
1438
- var depModifier = map.get(dep);
1439
-
1440
- if (depModifier) {
1441
- sort(depModifier);
1442
- }
1443
- }
1444
- });
1445
- result.push(modifier);
1446
- }
1447
-
1448
- modifiers.forEach(function (modifier) {
1449
- if (!visited.has(modifier.name)) {
1450
- // check for visited object
1451
- sort(modifier);
1452
- }
1453
- });
1454
- return result;
1455
- }
1456
-
1457
- function orderModifiers(modifiers) {
1458
- // order based on dependencies
1459
- var orderedModifiers = order(modifiers); // order based on phase
1460
-
1461
- return modifierPhases.reduce(function (acc, phase) {
1462
- return acc.concat(orderedModifiers.filter(function (modifier) {
1463
- return modifier.phase === phase;
1464
- }));
1465
- }, []);
1466
- }
1467
-
1468
- function debounce(fn) {
1469
- var pending;
1470
- return function () {
1471
- if (!pending) {
1472
- pending = new Promise(function (resolve) {
1473
- Promise.resolve().then(function () {
1474
- pending = undefined;
1475
- resolve(fn());
1476
- });
1477
- });
1478
- }
1479
-
1480
- return pending;
1481
- };
1482
- }
1483
-
1484
- function format(str) {
1485
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
1486
- args[_key - 1] = arguments[_key];
1487
- }
1488
-
1489
- return [].concat(args).reduce(function (p, c) {
1490
- return p.replace(/%s/, c);
1491
- }, str);
1492
- }
1493
-
1494
- var INVALID_MODIFIER_ERROR = 'Popper: modifier "%s" provided an invalid %s property, expected %s but got %s';
1495
- var MISSING_DEPENDENCY_ERROR = 'Popper: modifier "%s" requires "%s", but "%s" modifier is not available';
1496
- var VALID_PROPERTIES = ['name', 'enabled', 'phase', 'fn', 'effect', 'requires', 'options'];
1497
- function validateModifiers(modifiers) {
1498
- modifiers.forEach(function (modifier) {
1499
- Object.keys(modifier).forEach(function (key) {
1500
- switch (key) {
1501
- case 'name':
1502
- if (typeof modifier.name !== 'string') {
1503
- console.error(format(INVALID_MODIFIER_ERROR, String(modifier.name), '"name"', '"string"', "\"" + String(modifier.name) + "\""));
1504
- }
1505
-
1506
- break;
1507
-
1508
- case 'enabled':
1509
- if (typeof modifier.enabled !== 'boolean') {
1510
- console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"enabled"', '"boolean"', "\"" + String(modifier.enabled) + "\""));
1511
- }
1512
-
1513
- case 'phase':
1514
- if (modifierPhases.indexOf(modifier.phase) < 0) {
1515
- console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"phase"', "either " + modifierPhases.join(', '), "\"" + String(modifier.phase) + "\""));
1516
- }
1517
-
1518
- break;
1519
-
1520
- case 'fn':
1521
- if (typeof modifier.fn !== 'function') {
1522
- console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"fn"', '"function"', "\"" + String(modifier.fn) + "\""));
1523
- }
1524
-
1525
- break;
1526
-
1527
- case 'effect':
1528
- if (typeof modifier.effect !== 'function') {
1529
- console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"effect"', '"function"', "\"" + String(modifier.fn) + "\""));
1530
- }
1531
-
1532
- break;
1533
-
1534
- case 'requires':
1535
- if (!Array.isArray(modifier.requires)) {
1536
- console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requires"', '"array"', "\"" + String(modifier.requires) + "\""));
1537
- }
1538
-
1539
- break;
1540
-
1541
- case 'requiresIfExists':
1542
- if (!Array.isArray(modifier.requiresIfExists)) {
1543
- console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requiresIfExists"', '"array"', "\"" + String(modifier.requiresIfExists) + "\""));
1544
- }
1545
-
1546
- break;
1547
-
1548
- case 'options':
1549
- case 'data':
1550
- break;
1551
-
1552
- default:
1553
- console.error("PopperJS: an invalid property has been provided to the \"" + modifier.name + "\" modifier, valid properties are " + VALID_PROPERTIES.map(function (s) {
1554
- return "\"" + s + "\"";
1555
- }).join(', ') + "; but \"" + key + "\" was provided.");
1556
- }
1557
-
1558
- modifier.requires && modifier.requires.forEach(function (requirement) {
1559
- if (modifiers.find(function (mod) {
1560
- return mod.name === requirement;
1561
- }) == null) {
1562
- console.error(format(MISSING_DEPENDENCY_ERROR, String(modifier.name), requirement, requirement));
1563
- }
1564
- });
1565
- });
1566
- });
1567
- }
1568
-
1569
- function uniqueBy(arr, fn) {
1570
- var identifiers = new Set();
1571
- return arr.filter(function (item) {
1572
- var identifier = fn(item);
1573
-
1574
- if (!identifiers.has(identifier)) {
1575
- identifiers.add(identifier);
1576
- return true;
1577
- }
1578
- });
1579
- }
1580
-
1581
- function mergeByName(modifiers) {
1582
- var merged = modifiers.reduce(function (merged, current) {
1583
- var existing = merged[current.name];
1584
- merged[current.name] = existing ? Object.assign(Object.assign(Object.assign({}, existing), current), {}, {
1585
- options: Object.assign(Object.assign({}, existing.options), current.options),
1586
- data: Object.assign(Object.assign({}, existing.data), current.data)
1587
- }) : current;
1588
- return merged;
1589
- }, {}); // IE11 does not support Object.values
1590
-
1591
- return Object.keys(merged).map(function (key) {
1592
- return merged[key];
1593
- });
1594
- }
1595
-
1596
- var INVALID_ELEMENT_ERROR = 'Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.';
1597
- var INFINITE_LOOP_ERROR = 'Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.';
1598
- var DEFAULT_OPTIONS = {
1599
- placement: 'bottom',
1600
- modifiers: [],
1601
- strategy: 'absolute'
1602
- };
1603
-
1604
- function areValidElements() {
1605
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1606
- args[_key] = arguments[_key];
1607
- }
1608
-
1609
- return !args.some(function (element) {
1610
- return !(element && typeof element.getBoundingClientRect === 'function');
1611
- });
1612
- }
1613
-
1614
- function popperGenerator(generatorOptions) {
1615
- if (generatorOptions === void 0) {
1616
- generatorOptions = {};
1617
- }
1618
-
1619
- var _generatorOptions = generatorOptions,
1620
- _generatorOptions$def = _generatorOptions.defaultModifiers,
1621
- defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,
1622
- _generatorOptions$def2 = _generatorOptions.defaultOptions,
1623
- defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;
1624
- return function createPopper(reference, popper, options) {
1625
- if (options === void 0) {
1626
- options = defaultOptions;
1627
- }
1628
-
1629
- var state = {
1630
- placement: 'bottom',
1631
- orderedModifiers: [],
1632
- options: Object.assign(Object.assign({}, DEFAULT_OPTIONS), defaultOptions),
1633
- modifiersData: {},
1634
- elements: {
1635
- reference: reference,
1636
- popper: popper
1637
- },
1638
- attributes: {},
1639
- styles: {}
1640
- };
1641
- var effectCleanupFns = [];
1642
- var isDestroyed = false;
1643
- var instance = {
1644
- state: state,
1645
- setOptions: function setOptions(options) {
1646
- cleanupModifierEffects();
1647
- state.options = Object.assign(Object.assign(Object.assign({}, defaultOptions), state.options), options);
1648
- state.scrollParents = {
1649
- reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],
1650
- popper: listScrollParents(popper)
1651
- }; // Orders the modifiers based on their dependencies and `phase`
1652
- // properties
1653
-
1654
- var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers
1655
-
1656
- state.orderedModifiers = orderedModifiers.filter(function (m) {
1657
- return m.enabled;
1658
- }); // Validate the provided modifiers so that the consumer will get warned
1659
- // if one of the modifiers is invalid for any reason
1660
-
1661
- if (process.env.NODE_ENV !== "production") {
1662
- var modifiers = uniqueBy([].concat(orderedModifiers, state.options.modifiers), function (_ref) {
1663
- var name = _ref.name;
1664
- return name;
1665
- });
1666
- validateModifiers(modifiers);
1667
-
1668
- if (getBasePlacement(state.options.placement) === auto) {
1669
- var flipModifier = state.orderedModifiers.find(function (_ref2) {
1670
- var name = _ref2.name;
1671
- return name === 'flip';
1672
- });
1673
-
1674
- if (!flipModifier) {
1675
- console.error(['Popper: "auto" placements require the "flip" modifier be', 'present and enabled to work.'].join(' '));
1676
- }
1677
- }
1678
-
1679
- var _getComputedStyle = getComputedStyle(popper),
1680
- marginTop = _getComputedStyle.marginTop,
1681
- marginRight = _getComputedStyle.marginRight,
1682
- marginBottom = _getComputedStyle.marginBottom,
1683
- marginLeft = _getComputedStyle.marginLeft; // We no longer take into account `margins` on the popper, and it can
1684
- // cause bugs with positioning, so we'll warn the consumer
1685
-
1686
-
1687
- if ([marginTop, marginRight, marginBottom, marginLeft].some(function (margin) {
1688
- return parseFloat(margin);
1689
- })) {
1690
- console.warn(['Popper: CSS "margin" styles cannot be used to apply padding', 'between the popper and its reference element or boundary.', 'To replicate margin, use the `offset` modifier, as well as', 'the `padding` option in the `preventOverflow` and `flip`', 'modifiers.'].join(' '));
1691
- }
1692
- }
1693
-
1694
- runModifierEffects();
1695
- return instance.update();
1696
- },
1697
- // Sync update – it will always be executed, even if not necessary. This
1698
- // is useful for low frequency updates where sync behavior simplifies the
1699
- // logic.
1700
- // For high frequency updates (e.g. `resize` and `scroll` events), always
1701
- // prefer the async Popper#update method
1702
- forceUpdate: function forceUpdate() {
1703
- if (isDestroyed) {
1704
- return;
1705
- }
1706
-
1707
- var _state$elements = state.elements,
1708
- reference = _state$elements.reference,
1709
- popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements
1710
- // anymore
1711
-
1712
- if (!areValidElements(reference, popper)) {
1713
- if (process.env.NODE_ENV !== "production") {
1714
- console.error(INVALID_ELEMENT_ERROR);
1715
- }
1716
-
1717
- return;
1718
- } // Store the reference and popper rects to be read by modifiers
1719
-
1720
-
1721
- state.rects = {
1722
- reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),
1723
- popper: getLayoutRect(popper)
1724
- }; // Modifiers have the ability to reset the current update cycle. The
1725
- // most common use case for this is the `flip` modifier changing the
1726
- // placement, which then needs to re-run all the modifiers, because the
1727
- // logic was previously ran for the previous placement and is therefore
1728
- // stale/incorrect
1729
-
1730
- state.reset = false;
1731
- state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier
1732
- // is filled with the initial data specified by the modifier. This means
1733
- // it doesn't persist and is fresh on each update.
1734
- // To ensure persistent data, use `${name}#persistent`
1735
-
1736
- state.orderedModifiers.forEach(function (modifier) {
1737
- return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
1738
- });
1739
- var __debug_loops__ = 0;
1740
-
1741
- for (var index = 0; index < state.orderedModifiers.length; index++) {
1742
- if (process.env.NODE_ENV !== "production") {
1743
- __debug_loops__ += 1;
1744
-
1745
- if (__debug_loops__ > 100) {
1746
- console.error(INFINITE_LOOP_ERROR);
1747
- break;
1748
- }
1749
- }
1750
-
1751
- if (state.reset === true) {
1752
- state.reset = false;
1753
- index = -1;
1754
- continue;
1755
- }
1756
-
1757
- var _state$orderedModifie = state.orderedModifiers[index],
1758
- fn = _state$orderedModifie.fn,
1759
- _state$orderedModifie2 = _state$orderedModifie.options,
1760
- _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,
1761
- name = _state$orderedModifie.name;
1762
-
1763
- if (typeof fn === 'function') {
1764
- state = fn({
1765
- state: state,
1766
- options: _options,
1767
- name: name,
1768
- instance: instance
1769
- }) || state;
1770
- }
1771
- }
1772
- },
1773
- // Async and optimistically optimized update – it will not be executed if
1774
- // not necessary (debounced to run at most once-per-tick)
1775
- update: debounce(function () {
1776
- return new Promise(function (resolve) {
1777
- instance.forceUpdate();
1778
- resolve(state);
1779
- });
1780
- }),
1781
- destroy: function destroy() {
1782
- cleanupModifierEffects();
1783
- isDestroyed = true;
1784
- }
1785
- };
1786
-
1787
- if (!areValidElements(reference, popper)) {
1788
- if (process.env.NODE_ENV !== "production") {
1789
- console.error(INVALID_ELEMENT_ERROR);
1790
- }
1791
-
1792
- return instance;
1793
- }
1794
-
1795
- instance.setOptions(options).then(function (state) {
1796
- if (!isDestroyed && options.onFirstUpdate) {
1797
- options.onFirstUpdate(state);
1798
- }
1799
- }); // Modifiers have the ability to execute arbitrary code before the first
1800
- // update cycle runs. They will be executed in the same order as the update
1801
- // cycle. This is useful when a modifier adds some persistent data that
1802
- // other modifiers need to use, but the modifier is run after the dependent
1803
- // one.
1804
-
1805
- function runModifierEffects() {
1806
- state.orderedModifiers.forEach(function (_ref3) {
1807
- var name = _ref3.name,
1808
- _ref3$options = _ref3.options,
1809
- options = _ref3$options === void 0 ? {} : _ref3$options,
1810
- effect = _ref3.effect;
1811
-
1812
- if (typeof effect === 'function') {
1813
- var cleanupFn = effect({
1814
- state: state,
1815
- name: name,
1816
- instance: instance,
1817
- options: options
1818
- });
1819
-
1820
- var noopFn = function noopFn() {};
1821
-
1822
- effectCleanupFns.push(cleanupFn || noopFn);
1823
- }
1824
- });
1825
- }
1826
-
1827
- function cleanupModifierEffects() {
1828
- effectCleanupFns.forEach(function (fn) {
1829
- return fn();
1830
- });
1831
- effectCleanupFns = [];
1832
- }
1833
-
1834
- return instance;
1835
- };
1836
- }
1837
-
1838
- var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$1, flip$1, preventOverflow$1, arrow$1, hide$1];
1839
- var createPopper = /*#__PURE__*/popperGenerator({
1840
- defaultModifiers: defaultModifiers
1841
- }); // eslint-disable-next-line import/no-unused-modules
1842
-
1843
- /**
1844
- * Simple ponyfill for Object.fromEntries
1845
- */
1846
-
1847
- var fromEntries = function fromEntries(entries) {
1848
- return entries.reduce(function (acc, _ref) {
1849
- var key = _ref[0],
1850
- value = _ref[1];
1851
- acc[key] = value;
1852
- return acc;
1853
- }, {});
1854
- };
1855
- /**
1856
- * Small wrapper around `useLayoutEffect` to get rid of the warning on SSR envs
1857
- */
1858
-
1859
- var useIsomorphicLayoutEffect = typeof window !== 'undefined' && window.document && window.document.createElement ? React.useLayoutEffect : React.useEffect;
1860
-
1861
- /* global Map:readonly, Set:readonly, ArrayBuffer:readonly */
1862
-
1863
- var reactFastCompare;
1864
- var hasRequiredReactFastCompare;
1865
-
1866
- function requireReactFastCompare () {
1867
- if (hasRequiredReactFastCompare) return reactFastCompare;
1868
- hasRequiredReactFastCompare = 1;
1869
- var hasElementType = typeof Element !== 'undefined';
1870
- var hasMap = typeof Map === 'function';
1871
- var hasSet = typeof Set === 'function';
1872
- var hasArrayBuffer = typeof ArrayBuffer === 'function' && !!ArrayBuffer.isView;
1873
-
1874
- // Note: We **don't** need `envHasBigInt64Array` in fde es6/index.js
1875
-
1876
- function equal(a, b) {
1877
- // START: fast-deep-equal es6/index.js 3.1.1
1878
- if (a === b) return true;
1879
-
1880
- if (a && b && typeof a == 'object' && typeof b == 'object') {
1881
- if (a.constructor !== b.constructor) return false;
1882
-
1883
- var length, i, keys;
1884
- if (Array.isArray(a)) {
1885
- length = a.length;
1886
- if (length != b.length) return false;
1887
- for (i = length; i-- !== 0;)
1888
- if (!equal(a[i], b[i])) return false;
1889
- return true;
1890
- }
1891
-
1892
- // START: Modifications:
1893
- // 1. Extra `has<Type> &&` helpers in initial condition allow es6 code
1894
- // to co-exist with es5.
1895
- // 2. Replace `for of` with es5 compliant iteration using `for`.
1896
- // Basically, take:
1897
- //
1898
- // ```js
1899
- // for (i of a.entries())
1900
- // if (!b.has(i[0])) return false;
1901
- // ```
1902
- //
1903
- // ... and convert to:
1904
- //
1905
- // ```js
1906
- // it = a.entries();
1907
- // while (!(i = it.next()).done)
1908
- // if (!b.has(i.value[0])) return false;
1909
- // ```
1910
- //
1911
- // **Note**: `i` access switches to `i.value`.
1912
- var it;
1913
- if (hasMap && (a instanceof Map) && (b instanceof Map)) {
1914
- if (a.size !== b.size) return false;
1915
- it = a.entries();
1916
- while (!(i = it.next()).done)
1917
- if (!b.has(i.value[0])) return false;
1918
- it = a.entries();
1919
- while (!(i = it.next()).done)
1920
- if (!equal(i.value[1], b.get(i.value[0]))) return false;
1921
- return true;
1922
- }
1923
-
1924
- if (hasSet && (a instanceof Set) && (b instanceof Set)) {
1925
- if (a.size !== b.size) return false;
1926
- it = a.entries();
1927
- while (!(i = it.next()).done)
1928
- if (!b.has(i.value[0])) return false;
1929
- return true;
1930
- }
1931
- // END: Modifications
1932
-
1933
- if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {
1934
- length = a.length;
1935
- if (length != b.length) return false;
1936
- for (i = length; i-- !== 0;)
1937
- if (a[i] !== b[i]) return false;
1938
- return true;
1939
- }
1940
-
1941
- if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
1942
- if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
1943
- if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
1944
-
1945
- keys = Object.keys(a);
1946
- length = keys.length;
1947
- if (length !== Object.keys(b).length) return false;
1948
-
1949
- for (i = length; i-- !== 0;)
1950
- if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
1951
- // END: fast-deep-equal
1952
-
1953
- // START: react-fast-compare
1954
- // custom handling for DOM elements
1955
- if (hasElementType && a instanceof Element) return false;
1956
-
1957
- // custom handling for React/Preact
1958
- for (i = length; i-- !== 0;) {
1959
- if ((keys[i] === '_owner' || keys[i] === '__v' || keys[i] === '__o') && a.$$typeof) {
1960
- // React-specific: avoid traversing React elements' _owner
1961
- // Preact-specific: avoid traversing Preact elements' __v and __o
1962
- // __v = $_original / $_vnode
1963
- // __o = $_owner
1964
- // These properties contain circular references and are not needed when
1965
- // comparing the actual elements (and not their owners)
1966
- // .$$typeof and ._store on just reasonable markers of elements
1967
-
1968
- continue;
1969
- }
1970
-
1971
- // all other properties should be traversed as usual
1972
- if (!equal(a[keys[i]], b[keys[i]])) return false;
1973
- }
1974
- // END: react-fast-compare
1975
-
1976
- // START: fast-deep-equal
1977
- return true;
1978
- }
1979
-
1980
- return a !== a && b !== b;
1981
- }
1982
- // end fast-deep-equal
1983
-
1984
- reactFastCompare = function isEqual(a, b) {
1985
- try {
1986
- return equal(a, b);
1987
- } catch (error) {
1988
- if (((error.message || '').match(/stack|recursion/i))) {
1989
- // warn on circular references, don't crash
1990
- // browsers give this different errors name and messages:
1991
- // chrome/safari: "RangeError", "Maximum call stack size exceeded"
1992
- // firefox: "InternalError", too much recursion"
1993
- // edge: "Error", "Out of stack space"
1994
- console.warn('react-fast-compare cannot handle circular refs');
1995
- return false;
1996
- }
1997
- // some other error. we should definitely know about these
1998
- throw error;
1999
- }
2000
- };
2001
- return reactFastCompare;
2002
- }
2003
-
2004
- var reactFastCompareExports = requireReactFastCompare();
2005
- var isEqual = /*@__PURE__*/getDefaultExportFromCjs(reactFastCompareExports);
2006
-
2007
- var EMPTY_MODIFIERS = [];
2008
- var usePopper$1 = function usePopper(referenceElement, popperElement, options) {
2009
- if (options === void 0) {
2010
- options = {};
2011
- }
2012
-
2013
- var prevOptions = React.useRef(null);
2014
- var optionsWithDefaults = {
2015
- onFirstUpdate: options.onFirstUpdate,
2016
- placement: options.placement || 'bottom',
2017
- strategy: options.strategy || 'absolute',
2018
- modifiers: options.modifiers || EMPTY_MODIFIERS
2019
- };
2020
-
2021
- var _React$useState = React.useState({
2022
- styles: {
2023
- popper: {
2024
- position: optionsWithDefaults.strategy,
2025
- left: '0',
2026
- top: '0'
2027
- }
2028
- },
2029
- attributes: {}
2030
- }),
2031
- state = _React$useState[0],
2032
- setState = _React$useState[1];
2033
-
2034
- var updateStateModifier = React.useMemo(function () {
2035
- return {
2036
- name: 'updateState',
2037
- enabled: true,
2038
- phase: 'write',
2039
- fn: function fn(_ref) {
2040
- var state = _ref.state;
2041
- var elements = Object.keys(state.elements);
2042
- setState({
2043
- styles: fromEntries(elements.map(function (element) {
2044
- return [element, state.styles[element] || {}];
2045
- })),
2046
- attributes: fromEntries(elements.map(function (element) {
2047
- return [element, state.attributes[element]];
2048
- }))
2049
- });
2050
- },
2051
- requires: ['computeStyles']
2052
- };
2053
- }, []);
2054
- var popperOptions = React.useMemo(function () {
2055
- var newOptions = {
2056
- onFirstUpdate: optionsWithDefaults.onFirstUpdate,
2057
- placement: optionsWithDefaults.placement,
2058
- strategy: optionsWithDefaults.strategy,
2059
- modifiers: [].concat(optionsWithDefaults.modifiers, [updateStateModifier, {
2060
- name: 'applyStyles',
2061
- enabled: false
2062
- }])
2063
- };
2064
-
2065
- if (isEqual(prevOptions.current, newOptions)) {
2066
- return prevOptions.current || newOptions;
2067
- } else {
2068
- prevOptions.current = newOptions;
2069
- return newOptions;
2070
- }
2071
- }, [optionsWithDefaults.onFirstUpdate, optionsWithDefaults.placement, optionsWithDefaults.strategy, optionsWithDefaults.modifiers, updateStateModifier]);
2072
- var popperInstanceRef = React.useRef();
2073
- useIsomorphicLayoutEffect(function () {
2074
- if (popperInstanceRef.current) {
2075
- popperInstanceRef.current.setOptions(popperOptions);
2076
- }
2077
- }, [popperOptions]);
2078
- useIsomorphicLayoutEffect(function () {
2079
- if (referenceElement == null || popperElement == null) {
2080
- return;
2081
- }
2082
-
2083
- var createPopper$1 = options.createPopper || createPopper;
2084
- var popperInstance = createPopper$1(referenceElement, popperElement, popperOptions);
2085
- popperInstanceRef.current = popperInstance;
2086
- return function () {
2087
- popperInstance.destroy();
2088
- popperInstanceRef.current = null;
2089
- };
2090
- }, [referenceElement, popperElement, options.createPopper]);
2091
- return {
2092
- state: popperInstanceRef.current ? popperInstanceRef.current.state : null,
2093
- styles: state.styles,
2094
- attributes: state.attributes,
2095
- update: popperInstanceRef.current ? popperInstanceRef.current.update : null,
2096
- forceUpdate: popperInstanceRef.current ? popperInstanceRef.current.forceUpdate : null
2097
- };
2098
- };
2099
-
2100
- /** Stub usePopper for use outside of browsers */
2101
- const useStubPopper = (_a, _p, {
2102
- placement
2103
- }) => ({
2104
- attributes: {
2105
- popper: {
2106
- 'data-popper-placement': placement
2107
- }
2108
- },
2109
- styles: {
2110
- popper: {
2111
- transform: 'translate(1, 1)'
2112
- }
2113
- }
2114
- });
2115
-
2116
- /** Switch hook implementation between environment */
2117
- const usePopper = IS_BROWSER ? usePopper$1 : useStubPopper;
2118
-
2119
- /**
2120
- * Different possible placements for the popover.
2121
- */
2122
- const Placement = {
2123
- AUTO: 'auto',
2124
- AUTO_END: 'auto-end',
2125
- AUTO_START: 'auto-start',
2126
- TOP: 'top',
2127
- TOP_END: 'top-end',
2128
- TOP_START: 'top-start',
2129
- RIGHT: 'right',
2130
- RIGHT_END: 'right-end',
2131
- RIGHT_START: 'right-start',
2132
- BOTTOM: 'bottom',
2133
- BOTTOM_END: 'bottom-end',
2134
- BOTTOM_START: 'bottom-start',
2135
- LEFT: 'left',
2136
- LEFT_END: 'left-end',
2137
- LEFT_START: 'left-start'
2138
- };
2139
-
2140
- /**
2141
- * Offset of the popover.
2142
- */
2143
-
2144
- /**
2145
- * Popover elevation index.
2146
- */
2147
-
2148
- /**
2149
- * Popover fit anchor width options.
2150
- */
2151
- const FitAnchorWidth = {
2152
- MAX_WIDTH: 'maxWidth',
2153
- MIN_WIDTH: 'minWidth',
2154
- WIDTH: 'width'
2155
- };
2156
- /**
2157
- * Arrow size (in pixel).
2158
- */
2159
- const ARROW_SIZE = 14;
2160
-
2161
- /**
2162
- * Popover default z-index
2163
- */
2164
- const POPOVER_ZINDEX = 9999;
2165
-
2166
- export { ARROW_SIZE as A, FitAnchorWidth as F, Placement as P, POPOVER_ZINDEX as a, detectOverflow as d, usePopper as u };
2167
- //# sourceMappingURL=constants-9b714e31.js.map