wcs-core 2.6.0 → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +16 -0
  3. package/dist/cjs/{helpers-d9aaa8c4.js → helpers-6abce594.js} +5 -0
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/popper-6a290c40.js +1731 -0
  6. package/dist/cjs/wcs-button.cjs.entry.js +1 -1
  7. package/dist/cjs/wcs-checkbox.cjs.entry.js +6 -2
  8. package/dist/cjs/wcs-dropdown-divider.cjs.entry.js +19 -0
  9. package/dist/cjs/wcs-dropdown-header.cjs.entry.js +19 -0
  10. package/dist/cjs/wcs-dropdown.cjs.entry.js +43 -10
  11. package/dist/cjs/wcs-error_2.cjs.entry.js +1 -1
  12. package/dist/cjs/wcs-galactic-menu.cjs.entry.js +3 -1730
  13. package/dist/cjs/wcs-grid-column.cjs.entry.js +5 -1
  14. package/dist/cjs/wcs-grid.cjs.entry.js +28 -5
  15. package/dist/cjs/wcs-input.cjs.entry.js +3 -3
  16. package/dist/cjs/wcs-radio.cjs.entry.js +2 -2
  17. package/dist/cjs/wcs-select_2.cjs.entry.js +1 -1
  18. package/dist/cjs/wcs-switch.cjs.entry.js +10 -2
  19. package/dist/cjs/wcs-textarea.cjs.entry.js +2 -2
  20. package/dist/cjs/wcs.cjs.js +1 -1
  21. package/dist/collection/collection-manifest.json +2 -0
  22. package/dist/collection/components/checkbox/checkbox.css +18 -7
  23. package/dist/collection/components/checkbox/checkbox.js +24 -2
  24. package/dist/collection/components/dropdown/dropdown-interface.js +1 -0
  25. package/dist/collection/components/dropdown/dropdown.css +46 -38
  26. package/dist/collection/components/dropdown/dropdown.js +90 -29
  27. package/dist/collection/components/dropdown-divider/dropdown-divider.css +7 -0
  28. package/dist/collection/components/dropdown-divider/dropdown-divider.js +14 -0
  29. package/dist/collection/components/dropdown-header/dropdown-header.css +8 -0
  30. package/dist/collection/components/dropdown-header/dropdown-header.js +15 -0
  31. package/dist/collection/components/form-field/form-field.css +1 -1
  32. package/dist/collection/components/grid/grid.js +28 -5
  33. package/dist/collection/components/grid-column/grid-column.js +7 -1
  34. package/dist/collection/components/input/input.css +48 -0
  35. package/dist/collection/components/input/input.js +38 -2
  36. package/dist/collection/components/radio/radio.component.js +1 -1
  37. package/dist/collection/components/radio/radio.css +18 -4
  38. package/dist/collection/components/radio-group/radio-group.js +7 -2
  39. package/dist/collection/components/switch/switch.css +53 -16
  40. package/dist/collection/components/switch/switch.js +55 -6
  41. package/dist/collection/components/textarea/textarea.css +4 -0
  42. package/dist/collection/utils/helpers.js +4 -0
  43. package/dist/esm/{helpers-50436c51.js → helpers-e2993152.js} +5 -1
  44. package/dist/esm/loader.js +1 -1
  45. package/dist/esm/popper-e5fdfb6a.js +1729 -0
  46. package/dist/esm/wcs-button.entry.js +1 -1
  47. package/dist/esm/wcs-checkbox.entry.js +6 -2
  48. package/dist/esm/wcs-dropdown-divider.entry.js +15 -0
  49. package/dist/esm/wcs-dropdown-header.entry.js +15 -0
  50. package/dist/esm/wcs-dropdown.entry.js +43 -10
  51. package/dist/esm/wcs-error_2.entry.js +1 -1
  52. package/dist/esm/wcs-galactic-menu.entry.js +2 -1729
  53. package/dist/esm/wcs-grid-column.entry.js +5 -1
  54. package/dist/esm/wcs-grid.entry.js +28 -5
  55. package/dist/esm/wcs-input.entry.js +3 -3
  56. package/dist/esm/wcs-radio.entry.js +2 -2
  57. package/dist/esm/wcs-select_2.entry.js +1 -1
  58. package/dist/esm/wcs-switch.entry.js +10 -2
  59. package/dist/esm/wcs-textarea.entry.js +2 -2
  60. package/dist/esm/wcs.js +1 -1
  61. package/dist/types/components/checkbox/checkbox.d.ts +4 -0
  62. package/dist/types/components/dropdown/dropdown-interface.d.ts +1 -0
  63. package/dist/types/components/dropdown/dropdown.d.ts +13 -16
  64. package/dist/types/components/dropdown-divider/dropdown-divider.d.ts +3 -0
  65. package/dist/types/components/dropdown-header/dropdown-header.d.ts +3 -0
  66. package/dist/types/components/grid/grid.d.ts +11 -0
  67. package/dist/types/components/grid-column/grid-column.d.ts +1 -0
  68. package/dist/types/components/input/input.d.ts +8 -0
  69. package/dist/types/components/radio-group/radio-group-interface.d.ts +1 -0
  70. package/dist/types/components/radio-group/radio-group.d.ts +2 -2
  71. package/dist/types/components/switch/switch-interface.d.ts +1 -0
  72. package/dist/types/components/switch/switch.d.ts +10 -2
  73. package/dist/types/components.d.ts +105 -4
  74. package/dist/types/utils/helpers.d.ts +1 -0
  75. package/dist/wcs/{p-356a8e3b.entry.js → p-384068f7.entry.js} +1 -1
  76. package/dist/wcs/p-41037455.entry.js +1 -0
  77. package/dist/wcs/p-57247184.entry.js +1 -0
  78. package/dist/wcs/p-7206e492.entry.js +1 -0
  79. package/dist/wcs/p-8c8740e3.entry.js +1 -0
  80. package/dist/wcs/p-a92d369e.entry.js +1 -0
  81. package/dist/wcs/p-a978c1e3.entry.js +1 -0
  82. package/dist/wcs/p-b5138986.js +1 -0
  83. package/dist/wcs/p-bbf1ef42.entry.js +1 -0
  84. package/dist/wcs/{p-3d10b02a.entry.js → p-c7d6d3e1.entry.js} +1 -1
  85. package/dist/wcs/p-cf4d7a83.js +1 -0
  86. package/dist/wcs/{p-a5a1b27c.entry.js → p-d7dec082.entry.js} +1 -1
  87. package/dist/wcs/p-e65d1c27.entry.js +1 -0
  88. package/dist/wcs/p-ea3e93e9.entry.js +1 -0
  89. package/dist/wcs/p-fbaf299d.entry.js +1 -0
  90. package/dist/wcs/{p-4338f140.entry.js → p-ff6d0dfd.entry.js} +1 -1
  91. package/dist/wcs/wcs.esm.js +1 -1
  92. package/package.json +1 -2
  93. package/dist/wcs/p-0fbe574e.entry.js +0 -1
  94. package/dist/wcs/p-62f7ab6d.entry.js +0 -1
  95. package/dist/wcs/p-83f1ad32.js +0 -1
  96. package/dist/wcs/p-8f0f9868.entry.js +0 -1
  97. package/dist/wcs/p-af1a5e52.entry.js +0 -1
  98. package/dist/wcs/p-bef44630.entry.js +0 -1
  99. package/dist/wcs/p-d59b4495.entry.js +0 -1
  100. package/dist/wcs/p-dd300dea.entry.js +0 -1
  101. package/dist/wcs/p-e486647c.entry.js +0 -1
@@ -1,1733 +1,6 @@
1
1
  import { r as registerInstance, h, H as Host, g as getElement } from './index-b982604a.js';
2
- import { c as clickInsideElement } from './helpers-50436c51.js';
3
-
4
- var top = 'top';
5
- var bottom = 'bottom';
6
- var right = 'right';
7
- var left = 'left';
8
- var auto = 'auto';
9
- var basePlacements = [top, bottom, right, left];
10
- var start = 'start';
11
- var end = 'end';
12
- var clippingParents = 'clippingParents';
13
- var viewport = 'viewport';
14
- var popper = 'popper';
15
- var reference = 'reference';
16
- var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {
17
- return acc.concat([placement + "-" + start, placement + "-" + end]);
18
- }, []);
19
- var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {
20
- return acc.concat([placement, placement + "-" + start, placement + "-" + end]);
21
- }, []); // modifiers that need to read the DOM
22
-
23
- var beforeRead = 'beforeRead';
24
- var read = 'read';
25
- var afterRead = 'afterRead'; // pure-logic modifiers
26
-
27
- var beforeMain = 'beforeMain';
28
- var main = 'main';
29
- var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)
30
-
31
- var beforeWrite = 'beforeWrite';
32
- var write = 'write';
33
- var afterWrite = 'afterWrite';
34
- var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
35
-
36
- function getNodeName(element) {
37
- return element ? (element.nodeName || '').toLowerCase() : null;
38
- }
39
-
40
- function getWindow(node) {
41
- if (node == null) {
42
- return window;
43
- }
44
-
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
- function isElement(node) {
54
- var OwnElement = getWindow(node).Element;
55
- return node instanceof OwnElement || node instanceof Element;
56
- }
57
-
58
- function isHTMLElement(node) {
59
- var OwnElement = getWindow(node).HTMLElement;
60
- return node instanceof OwnElement || node instanceof HTMLElement;
61
- }
62
-
63
- function isShadowRoot(node) {
64
- // IE 11 has no ShadowRoot
65
- if (typeof ShadowRoot === 'undefined') {
66
- return false;
67
- }
68
-
69
- var OwnElement = getWindow(node).ShadowRoot;
70
- return node instanceof OwnElement || node instanceof ShadowRoot;
71
- }
72
-
73
- // and applies them to the HTMLElements such as popper and arrow
74
-
75
- function applyStyles(_ref) {
76
- var state = _ref.state;
77
- Object.keys(state.elements).forEach(function (name) {
78
- var style = state.styles[name] || {};
79
- var attributes = state.attributes[name] || {};
80
- var element = state.elements[name]; // arrow is optional + virtual elements
81
-
82
- if (!isHTMLElement(element) || !getNodeName(element)) {
83
- return;
84
- } // Flow doesn't support to extend this property, but it's the most
85
- // effective way to apply styles to an HTMLElement
86
- // $FlowFixMe[cannot-write]
87
-
88
-
89
- Object.assign(element.style, style);
90
- Object.keys(attributes).forEach(function (name) {
91
- var value = attributes[name];
92
-
93
- if (value === false) {
94
- element.removeAttribute(name);
95
- } else {
96
- element.setAttribute(name, value === true ? '' : value);
97
- }
98
- });
99
- });
100
- }
101
-
102
- function effect$2(_ref2) {
103
- var state = _ref2.state;
104
- var initialStyles = {
105
- popper: {
106
- position: state.options.strategy,
107
- left: '0',
108
- top: '0',
109
- margin: '0'
110
- },
111
- arrow: {
112
- position: 'absolute'
113
- },
114
- reference: {}
115
- };
116
- Object.assign(state.elements.popper.style, initialStyles.popper);
117
- state.styles = initialStyles;
118
-
119
- if (state.elements.arrow) {
120
- Object.assign(state.elements.arrow.style, initialStyles.arrow);
121
- }
122
-
123
- return function () {
124
- Object.keys(state.elements).forEach(function (name) {
125
- var element = state.elements[name];
126
- var attributes = state.attributes[name] || {};
127
- var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them
128
-
129
- var style = styleProperties.reduce(function (style, property) {
130
- style[property] = '';
131
- return style;
132
- }, {}); // arrow is optional + virtual elements
133
-
134
- if (!isHTMLElement(element) || !getNodeName(element)) {
135
- return;
136
- }
137
-
138
- Object.assign(element.style, style);
139
- Object.keys(attributes).forEach(function (attribute) {
140
- element.removeAttribute(attribute);
141
- });
142
- });
143
- };
144
- } // eslint-disable-next-line import/no-unused-modules
145
-
146
-
147
- const applyStyles$1 = {
148
- name: 'applyStyles',
149
- enabled: true,
150
- phase: 'write',
151
- fn: applyStyles,
152
- effect: effect$2,
153
- requires: ['computeStyles']
154
- };
155
-
156
- function getBasePlacement(placement) {
157
- return placement.split('-')[0];
158
- }
159
-
160
- var round$1 = Math.round;
161
- function getBoundingClientRect(element, includeScale) {
162
- if (includeScale === void 0) {
163
- includeScale = false;
164
- }
165
-
166
- var rect = element.getBoundingClientRect();
167
- var scaleX = 1;
168
- var scaleY = 1;
169
-
170
- if (isHTMLElement(element) && includeScale) {
171
- // Fallback to 1 in case both values are `0`
172
- scaleX = rect.width / element.offsetWidth || 1;
173
- scaleY = rect.height / element.offsetHeight || 1;
174
- }
175
-
176
- return {
177
- width: round$1(rect.width / scaleX),
178
- height: round$1(rect.height / scaleY),
179
- top: round$1(rect.top / scaleY),
180
- right: round$1(rect.right / scaleX),
181
- bottom: round$1(rect.bottom / scaleY),
182
- left: round$1(rect.left / scaleX),
183
- x: round$1(rect.left / scaleX),
184
- y: round$1(rect.top / scaleY)
185
- };
186
- }
187
-
188
- // means it doesn't take into account transforms.
189
-
190
- function getLayoutRect(element) {
191
- var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.
192
- // Fixes https://github.com/popperjs/popper-core/issues/1223
193
-
194
- var width = element.offsetWidth;
195
- var height = element.offsetHeight;
196
-
197
- if (Math.abs(clientRect.width - width) <= 1) {
198
- width = clientRect.width;
199
- }
200
-
201
- if (Math.abs(clientRect.height - height) <= 1) {
202
- height = clientRect.height;
203
- }
204
-
205
- return {
206
- x: element.offsetLeft,
207
- y: element.offsetTop,
208
- width: width,
209
- height: height
210
- };
211
- }
212
-
213
- function contains(parent, child) {
214
- var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method
215
-
216
- if (parent.contains(child)) {
217
- return true;
218
- } // then fallback to custom implementation with Shadow DOM support
219
- else if (rootNode && isShadowRoot(rootNode)) {
220
- var next = child;
221
-
222
- do {
223
- if (next && parent.isSameNode(next)) {
224
- return true;
225
- } // $FlowFixMe[prop-missing]: need a better way to handle this...
226
-
227
-
228
- next = next.parentNode || next.host;
229
- } while (next);
230
- } // Give up, the result is false
231
-
232
-
233
- return false;
234
- }
235
-
236
- function getComputedStyle(element) {
237
- return getWindow(element).getComputedStyle(element);
238
- }
239
-
240
- function isTableElement(element) {
241
- return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;
242
- }
243
-
244
- function getDocumentElement(element) {
245
- // $FlowFixMe[incompatible-return]: assume body is always available
246
- return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]
247
- element.document) || window.document).documentElement;
248
- }
249
-
250
- function getParentNode(element) {
251
- if (getNodeName(element) === 'html') {
252
- return element;
253
- }
254
-
255
- return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle
256
- // $FlowFixMe[incompatible-return]
257
- // $FlowFixMe[prop-missing]
258
- element.assignedSlot || // step into the shadow DOM of the parent of a slotted node
259
- element.parentNode || ( // DOM Element detected
260
- isShadowRoot(element) ? element.host : null) || // ShadowRoot detected
261
- // $FlowFixMe[incompatible-call]: HTMLElement is a Node
262
- getDocumentElement(element) // fallback
263
-
264
- );
265
- }
266
-
267
- function getTrueOffsetParent(element) {
268
- if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837
269
- getComputedStyle(element).position === 'fixed') {
270
- return null;
271
- }
272
-
273
- return element.offsetParent;
274
- } // `.offsetParent` reports `null` for fixed elements, while absolute elements
275
- // return the containing block
276
-
277
-
278
- function getContainingBlock(element) {
279
- var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') !== -1;
280
- var isIE = navigator.userAgent.indexOf('Trident') !== -1;
281
-
282
- if (isIE && isHTMLElement(element)) {
283
- // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport
284
- var elementCss = getComputedStyle(element);
285
-
286
- if (elementCss.position === 'fixed') {
287
- return null;
288
- }
289
- }
290
-
291
- var currentNode = getParentNode(element);
292
-
293
- while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {
294
- var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that
295
- // create a containing block.
296
- // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
297
-
298
- if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') {
299
- return currentNode;
300
- } else {
301
- currentNode = currentNode.parentNode;
302
- }
303
- }
304
-
305
- return null;
306
- } // Gets the closest ancestor positioned element. Handles some edge cases,
307
- // such as table ancestors and cross browser bugs.
308
-
309
-
310
- function getOffsetParent(element) {
311
- var window = getWindow(element);
312
- var offsetParent = getTrueOffsetParent(element);
313
-
314
- while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {
315
- offsetParent = getTrueOffsetParent(offsetParent);
316
- }
317
-
318
- if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) {
319
- return window;
320
- }
321
-
322
- return offsetParent || getContainingBlock(element) || window;
323
- }
324
-
325
- function getMainAxisFromPlacement(placement) {
326
- return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';
327
- }
328
-
329
- var max = Math.max;
330
- var min = Math.min;
331
- var round = Math.round;
332
-
333
- function within(min$1, value, max$1) {
334
- return max(min$1, min(value, max$1));
335
- }
336
-
337
- function getFreshSideObject() {
338
- return {
339
- top: 0,
340
- right: 0,
341
- bottom: 0,
342
- left: 0
343
- };
344
- }
345
-
346
- function mergePaddingObject(paddingObject) {
347
- return Object.assign({}, getFreshSideObject(), paddingObject);
348
- }
349
-
350
- function expandToHashMap(value, keys) {
351
- return keys.reduce(function (hashMap, key) {
352
- hashMap[key] = value;
353
- return hashMap;
354
- }, {});
355
- }
356
-
357
- var toPaddingObject = function toPaddingObject(padding, state) {
358
- padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {
359
- placement: state.placement
360
- })) : padding;
361
- return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
362
- };
363
-
364
- function arrow(_ref) {
365
- var _state$modifiersData$;
366
-
367
- var state = _ref.state,
368
- name = _ref.name,
369
- options = _ref.options;
370
- var arrowElement = state.elements.arrow;
371
- var popperOffsets = state.modifiersData.popperOffsets;
372
- var basePlacement = getBasePlacement(state.placement);
373
- var axis = getMainAxisFromPlacement(basePlacement);
374
- var isVertical = [left, right].indexOf(basePlacement) >= 0;
375
- var len = isVertical ? 'height' : 'width';
376
-
377
- if (!arrowElement || !popperOffsets) {
378
- return;
379
- }
380
-
381
- var paddingObject = toPaddingObject(options.padding, state);
382
- var arrowRect = getLayoutRect(arrowElement);
383
- var minProp = axis === 'y' ? top : left;
384
- var maxProp = axis === 'y' ? bottom : right;
385
- var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];
386
- var startDiff = popperOffsets[axis] - state.rects.reference[axis];
387
- var arrowOffsetParent = getOffsetParent(arrowElement);
388
- var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
389
- var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is
390
- // outside of the popper bounds
391
-
392
- var min = paddingObject[minProp];
393
- var max = clientSize - arrowRect[len] - paddingObject[maxProp];
394
- var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;
395
- var offset = within(min, center, max); // Prevents breaking syntax highlighting...
396
-
397
- var axisProp = axis;
398
- state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);
399
- }
400
-
401
- function effect$1(_ref2) {
402
- var state = _ref2.state,
403
- options = _ref2.options;
404
- var _options$element = options.element,
405
- arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;
406
-
407
- if (arrowElement == null) {
408
- return;
409
- } // CSS selector
410
-
411
-
412
- if (typeof arrowElement === 'string') {
413
- arrowElement = state.elements.popper.querySelector(arrowElement);
414
-
415
- if (!arrowElement) {
416
- return;
417
- }
418
- }
419
-
420
- if (!contains(state.elements.popper, arrowElement)) {
421
-
422
- return;
423
- }
424
-
425
- state.elements.arrow = arrowElement;
426
- } // eslint-disable-next-line import/no-unused-modules
427
-
428
-
429
- const arrow$1 = {
430
- name: 'arrow',
431
- enabled: true,
432
- phase: 'main',
433
- fn: arrow,
434
- effect: effect$1,
435
- requires: ['popperOffsets'],
436
- requiresIfExists: ['preventOverflow']
437
- };
438
-
439
- var unsetSides = {
440
- top: 'auto',
441
- right: 'auto',
442
- bottom: 'auto',
443
- left: 'auto'
444
- }; // Round the offsets to the nearest suitable subpixel based on the DPR.
445
- // Zooming can change the DPR, but it seems to report a value that will
446
- // cleanly divide the values into the appropriate subpixels.
447
-
448
- function roundOffsetsByDPR(_ref) {
449
- var x = _ref.x,
450
- y = _ref.y;
451
- var win = window;
452
- var dpr = win.devicePixelRatio || 1;
453
- return {
454
- x: round(round(x * dpr) / dpr) || 0,
455
- y: round(round(y * dpr) / dpr) || 0
456
- };
457
- }
458
-
459
- function mapToStyles(_ref2) {
460
- var _Object$assign2;
461
-
462
- var popper = _ref2.popper,
463
- popperRect = _ref2.popperRect,
464
- placement = _ref2.placement,
465
- offsets = _ref2.offsets,
466
- position = _ref2.position,
467
- gpuAcceleration = _ref2.gpuAcceleration,
468
- adaptive = _ref2.adaptive,
469
- roundOffsets = _ref2.roundOffsets;
470
-
471
- var _ref3 = roundOffsets === true ? roundOffsetsByDPR(offsets) : typeof roundOffsets === 'function' ? roundOffsets(offsets) : offsets,
472
- _ref3$x = _ref3.x,
473
- x = _ref3$x === void 0 ? 0 : _ref3$x,
474
- _ref3$y = _ref3.y,
475
- y = _ref3$y === void 0 ? 0 : _ref3$y;
476
-
477
- var hasX = offsets.hasOwnProperty('x');
478
- var hasY = offsets.hasOwnProperty('y');
479
- var sideX = left;
480
- var sideY = top;
481
- var win = window;
482
-
483
- if (adaptive) {
484
- var offsetParent = getOffsetParent(popper);
485
- var heightProp = 'clientHeight';
486
- var widthProp = 'clientWidth';
487
-
488
- if (offsetParent === getWindow(popper)) {
489
- offsetParent = getDocumentElement(popper);
490
-
491
- if (getComputedStyle(offsetParent).position !== 'static') {
492
- heightProp = 'scrollHeight';
493
- widthProp = 'scrollWidth';
494
- }
495
- } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it
496
-
497
-
498
- offsetParent = offsetParent;
499
-
500
- if (placement === top) {
501
- sideY = bottom; // $FlowFixMe[prop-missing]
502
-
503
- y -= offsetParent[heightProp] - popperRect.height;
504
- y *= gpuAcceleration ? 1 : -1;
505
- }
506
-
507
- if (placement === left) {
508
- sideX = right; // $FlowFixMe[prop-missing]
509
-
510
- x -= offsetParent[widthProp] - popperRect.width;
511
- x *= gpuAcceleration ? 1 : -1;
512
- }
513
- }
514
-
515
- var commonStyles = Object.assign({
516
- position: position
517
- }, adaptive && unsetSides);
518
-
519
- if (gpuAcceleration) {
520
- var _Object$assign;
521
-
522
- return 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));
523
- }
524
-
525
- return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2));
526
- }
527
-
528
- function computeStyles(_ref4) {
529
- var state = _ref4.state,
530
- options = _ref4.options;
531
- var _options$gpuAccelerat = options.gpuAcceleration,
532
- gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,
533
- _options$adaptive = options.adaptive,
534
- adaptive = _options$adaptive === void 0 ? true : _options$adaptive,
535
- _options$roundOffsets = options.roundOffsets,
536
- roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
537
-
538
- var commonStyles = {
539
- placement: getBasePlacement(state.placement),
540
- popper: state.elements.popper,
541
- popperRect: state.rects.popper,
542
- gpuAcceleration: gpuAcceleration
543
- };
544
-
545
- if (state.modifiersData.popperOffsets != null) {
546
- state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {
547
- offsets: state.modifiersData.popperOffsets,
548
- position: state.options.strategy,
549
- adaptive: adaptive,
550
- roundOffsets: roundOffsets
551
- })));
552
- }
553
-
554
- if (state.modifiersData.arrow != null) {
555
- state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {
556
- offsets: state.modifiersData.arrow,
557
- position: 'absolute',
558
- adaptive: false,
559
- roundOffsets: roundOffsets
560
- })));
561
- }
562
-
563
- state.attributes.popper = Object.assign({}, state.attributes.popper, {
564
- 'data-popper-placement': state.placement
565
- });
566
- } // eslint-disable-next-line import/no-unused-modules
567
-
568
-
569
- const computeStyles$1 = {
570
- name: 'computeStyles',
571
- enabled: true,
572
- phase: 'beforeWrite',
573
- fn: computeStyles,
574
- data: {}
575
- };
576
-
577
- var passive = {
578
- passive: true
579
- };
580
-
581
- function effect(_ref) {
582
- var state = _ref.state,
583
- instance = _ref.instance,
584
- options = _ref.options;
585
- var _options$scroll = options.scroll,
586
- scroll = _options$scroll === void 0 ? true : _options$scroll,
587
- _options$resize = options.resize,
588
- resize = _options$resize === void 0 ? true : _options$resize;
589
- var window = getWindow(state.elements.popper);
590
- var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);
591
-
592
- if (scroll) {
593
- scrollParents.forEach(function (scrollParent) {
594
- scrollParent.addEventListener('scroll', instance.update, passive);
595
- });
596
- }
597
-
598
- if (resize) {
599
- window.addEventListener('resize', instance.update, passive);
600
- }
601
-
602
- return function () {
603
- if (scroll) {
604
- scrollParents.forEach(function (scrollParent) {
605
- scrollParent.removeEventListener('scroll', instance.update, passive);
606
- });
607
- }
608
-
609
- if (resize) {
610
- window.removeEventListener('resize', instance.update, passive);
611
- }
612
- };
613
- } // eslint-disable-next-line import/no-unused-modules
614
-
615
-
616
- const eventListeners = {
617
- name: 'eventListeners',
618
- enabled: true,
619
- phase: 'write',
620
- fn: function fn() {},
621
- effect: effect,
622
- data: {}
623
- };
624
-
625
- var hash$1 = {
626
- left: 'right',
627
- right: 'left',
628
- bottom: 'top',
629
- top: 'bottom'
630
- };
631
- function getOppositePlacement(placement) {
632
- return placement.replace(/left|right|bottom|top/g, function (matched) {
633
- return hash$1[matched];
634
- });
635
- }
636
-
637
- var hash = {
638
- start: 'end',
639
- end: 'start'
640
- };
641
- function getOppositeVariationPlacement(placement) {
642
- return placement.replace(/start|end/g, function (matched) {
643
- return hash[matched];
644
- });
645
- }
646
-
647
- function getWindowScroll(node) {
648
- var win = getWindow(node);
649
- var scrollLeft = win.pageXOffset;
650
- var scrollTop = win.pageYOffset;
651
- return {
652
- scrollLeft: scrollLeft,
653
- scrollTop: scrollTop
654
- };
655
- }
656
-
657
- function getWindowScrollBarX(element) {
658
- // If <html> has a CSS width greater than the viewport, then this will be
659
- // incorrect for RTL.
660
- // Popper 1 is broken in this case and never had a bug report so let's assume
661
- // it's not an issue. I don't think anyone ever specifies width on <html>
662
- // anyway.
663
- // Browsers where the left scrollbar doesn't cause an issue report `0` for
664
- // this (e.g. Edge 2019, IE11, Safari)
665
- return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
666
- }
667
-
668
- function getViewportRect(element) {
669
- var win = getWindow(element);
670
- var html = getDocumentElement(element);
671
- var visualViewport = win.visualViewport;
672
- var width = html.clientWidth;
673
- var height = html.clientHeight;
674
- var x = 0;
675
- var y = 0; // NB: This isn't supported on iOS <= 12. If the keyboard is open, the popper
676
- // can be obscured underneath it.
677
- // Also, `html.clientHeight` adds the bottom bar height in Safari iOS, even
678
- // if it isn't open, so if this isn't available, the popper will be detected
679
- // to overflow the bottom of the screen too early.
680
-
681
- if (visualViewport) {
682
- width = visualViewport.width;
683
- height = visualViewport.height; // Uses Layout Viewport (like Chrome; Safari does not currently)
684
- // In Chrome, it returns a value very close to 0 (+/-) but contains rounding
685
- // errors due to floating point numbers, so we need to check precision.
686
- // Safari returns a number <= 0, usually < -1 when pinch-zoomed
687
- // Feature detection fails in mobile emulation mode in Chrome.
688
- // Math.abs(win.innerWidth / visualViewport.scale - visualViewport.width) <
689
- // 0.001
690
- // Fallback here: "Not Safari" userAgent
691
-
692
- if (!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {
693
- x = visualViewport.offsetLeft;
694
- y = visualViewport.offsetTop;
695
- }
696
- }
697
-
698
- return {
699
- width: width,
700
- height: height,
701
- x: x + getWindowScrollBarX(element),
702
- y: y
703
- };
704
- }
705
-
706
- // of the `<html>` and `<body>` rect bounds if horizontally scrollable
707
-
708
- function getDocumentRect(element) {
709
- var _element$ownerDocumen;
710
-
711
- var html = getDocumentElement(element);
712
- var winScroll = getWindowScroll(element);
713
- var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
714
- var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
715
- var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
716
- var x = -winScroll.scrollLeft + getWindowScrollBarX(element);
717
- var y = -winScroll.scrollTop;
718
-
719
- if (getComputedStyle(body || html).direction === 'rtl') {
720
- x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
721
- }
722
-
723
- return {
724
- width: width,
725
- height: height,
726
- x: x,
727
- y: y
728
- };
729
- }
730
-
731
- function isScrollParent(element) {
732
- // Firefox wants us to check `-x` and `-y` variations as well
733
- var _getComputedStyle = getComputedStyle(element),
734
- overflow = _getComputedStyle.overflow,
735
- overflowX = _getComputedStyle.overflowX,
736
- overflowY = _getComputedStyle.overflowY;
737
-
738
- return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
739
- }
740
-
741
- function getScrollParent(node) {
742
- if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {
743
- // $FlowFixMe[incompatible-return]: assume body is always available
744
- return node.ownerDocument.body;
745
- }
746
-
747
- if (isHTMLElement(node) && isScrollParent(node)) {
748
- return node;
749
- }
750
-
751
- return getScrollParent(getParentNode(node));
752
- }
753
-
754
- /*
755
- given a DOM element, return the list of all scroll parents, up the list of ancesors
756
- until we get to the top window object. This list is what we attach scroll listeners
757
- to, because if any of these parent elements scroll, we'll need to re-calculate the
758
- reference element's position.
759
- */
760
-
761
- function listScrollParents(element, list) {
762
- var _element$ownerDocumen;
763
-
764
- if (list === void 0) {
765
- list = [];
766
- }
767
-
768
- var scrollParent = getScrollParent(element);
769
- var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
770
- var win = getWindow(scrollParent);
771
- var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
772
- var updatedList = list.concat(target);
773
- return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
774
- updatedList.concat(listScrollParents(getParentNode(target)));
775
- }
776
-
777
- function rectToClientRect(rect) {
778
- return Object.assign({}, rect, {
779
- left: rect.x,
780
- top: rect.y,
781
- right: rect.x + rect.width,
782
- bottom: rect.y + rect.height
783
- });
784
- }
785
-
786
- function getInnerBoundingClientRect(element) {
787
- var rect = getBoundingClientRect(element);
788
- rect.top = rect.top + element.clientTop;
789
- rect.left = rect.left + element.clientLeft;
790
- rect.bottom = rect.top + element.clientHeight;
791
- rect.right = rect.left + element.clientWidth;
792
- rect.width = element.clientWidth;
793
- rect.height = element.clientHeight;
794
- rect.x = rect.left;
795
- rect.y = rect.top;
796
- return rect;
797
- }
798
-
799
- function getClientRectFromMixedType(element, clippingParent) {
800
- return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isHTMLElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
801
- } // A "clipping parent" is an overflowable container with the characteristic of
802
- // clipping (or hiding) overflowing elements with a position different from
803
- // `initial`
804
-
805
-
806
- function getClippingParents(element) {
807
- var clippingParents = listScrollParents(getParentNode(element));
808
- var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;
809
- var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
810
-
811
- if (!isElement(clipperElement)) {
812
- return [];
813
- } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414
814
-
815
-
816
- return clippingParents.filter(function (clippingParent) {
817
- return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';
818
- });
819
- } // Gets the maximum area that the element is visible in due to any number of
820
- // clipping parents
821
-
822
-
823
- function getClippingRect(element, boundary, rootBoundary) {
824
- var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);
825
- var clippingParents = [].concat(mainClippingParents, [rootBoundary]);
826
- var firstClippingParent = clippingParents[0];
827
- var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {
828
- var rect = getClientRectFromMixedType(element, clippingParent);
829
- accRect.top = max(rect.top, accRect.top);
830
- accRect.right = min(rect.right, accRect.right);
831
- accRect.bottom = min(rect.bottom, accRect.bottom);
832
- accRect.left = max(rect.left, accRect.left);
833
- return accRect;
834
- }, getClientRectFromMixedType(element, firstClippingParent));
835
- clippingRect.width = clippingRect.right - clippingRect.left;
836
- clippingRect.height = clippingRect.bottom - clippingRect.top;
837
- clippingRect.x = clippingRect.left;
838
- clippingRect.y = clippingRect.top;
839
- return clippingRect;
840
- }
841
-
842
- function getVariation(placement) {
843
- return placement.split('-')[1];
844
- }
845
-
846
- function computeOffsets(_ref) {
847
- var reference = _ref.reference,
848
- element = _ref.element,
849
- placement = _ref.placement;
850
- var basePlacement = placement ? getBasePlacement(placement) : null;
851
- var variation = placement ? getVariation(placement) : null;
852
- var commonX = reference.x + reference.width / 2 - element.width / 2;
853
- var commonY = reference.y + reference.height / 2 - element.height / 2;
854
- var offsets;
855
-
856
- switch (basePlacement) {
857
- case top:
858
- offsets = {
859
- x: commonX,
860
- y: reference.y - element.height
861
- };
862
- break;
863
-
864
- case bottom:
865
- offsets = {
866
- x: commonX,
867
- y: reference.y + reference.height
868
- };
869
- break;
870
-
871
- case right:
872
- offsets = {
873
- x: reference.x + reference.width,
874
- y: commonY
875
- };
876
- break;
877
-
878
- case left:
879
- offsets = {
880
- x: reference.x - element.width,
881
- y: commonY
882
- };
883
- break;
884
-
885
- default:
886
- offsets = {
887
- x: reference.x,
888
- y: reference.y
889
- };
890
- }
891
-
892
- var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;
893
-
894
- if (mainAxis != null) {
895
- var len = mainAxis === 'y' ? 'height' : 'width';
896
-
897
- switch (variation) {
898
- case start:
899
- offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);
900
- break;
901
-
902
- case end:
903
- offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);
904
- break;
905
- }
906
- }
907
-
908
- return offsets;
909
- }
910
-
911
- function detectOverflow(state, options) {
912
- if (options === void 0) {
913
- options = {};
914
- }
915
-
916
- var _options = options,
917
- _options$placement = _options.placement,
918
- placement = _options$placement === void 0 ? state.placement : _options$placement,
919
- _options$boundary = _options.boundary,
920
- boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,
921
- _options$rootBoundary = _options.rootBoundary,
922
- rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,
923
- _options$elementConte = _options.elementContext,
924
- elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,
925
- _options$altBoundary = _options.altBoundary,
926
- altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,
927
- _options$padding = _options.padding,
928
- padding = _options$padding === void 0 ? 0 : _options$padding;
929
- var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
930
- var altContext = elementContext === popper ? reference : popper;
931
- var referenceElement = state.elements.reference;
932
- var popperRect = state.rects.popper;
933
- var element = state.elements[altBoundary ? altContext : elementContext];
934
- var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary);
935
- var referenceClientRect = getBoundingClientRect(referenceElement);
936
- var popperOffsets = computeOffsets({
937
- reference: referenceClientRect,
938
- element: popperRect,
939
- strategy: 'absolute',
940
- placement: placement
941
- });
942
- var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));
943
- var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect
944
- // 0 or negative = within the clipping rect
945
-
946
- var overflowOffsets = {
947
- top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
948
- bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
949
- left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
950
- right: elementClientRect.right - clippingClientRect.right + paddingObject.right
951
- };
952
- var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element
953
-
954
- if (elementContext === popper && offsetData) {
955
- var offset = offsetData[placement];
956
- Object.keys(overflowOffsets).forEach(function (key) {
957
- var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;
958
- var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';
959
- overflowOffsets[key] += offset[axis] * multiply;
960
- });
961
- }
962
-
963
- return overflowOffsets;
964
- }
965
-
966
- function computeAutoPlacement(state, options) {
967
- if (options === void 0) {
968
- options = {};
969
- }
970
-
971
- var _options = options,
972
- placement = _options.placement,
973
- boundary = _options.boundary,
974
- rootBoundary = _options.rootBoundary,
975
- padding = _options.padding,
976
- flipVariations = _options.flipVariations,
977
- _options$allowedAutoP = _options.allowedAutoPlacements,
978
- allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP;
979
- var variation = getVariation(placement);
980
- var placements$1 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {
981
- return getVariation(placement) === variation;
982
- }) : basePlacements;
983
- var allowedPlacements = placements$1.filter(function (placement) {
984
- return allowedAutoPlacements.indexOf(placement) >= 0;
985
- });
986
-
987
- if (allowedPlacements.length === 0) {
988
- allowedPlacements = placements$1;
989
- } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...
990
-
991
-
992
- var overflows = allowedPlacements.reduce(function (acc, placement) {
993
- acc[placement] = detectOverflow(state, {
994
- placement: placement,
995
- boundary: boundary,
996
- rootBoundary: rootBoundary,
997
- padding: padding
998
- })[getBasePlacement(placement)];
999
- return acc;
1000
- }, {});
1001
- return Object.keys(overflows).sort(function (a, b) {
1002
- return overflows[a] - overflows[b];
1003
- });
1004
- }
1005
-
1006
- function getExpandedFallbackPlacements(placement) {
1007
- if (getBasePlacement(placement) === auto) {
1008
- return [];
1009
- }
1010
-
1011
- var oppositePlacement = getOppositePlacement(placement);
1012
- return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];
1013
- }
1014
-
1015
- function flip(_ref) {
1016
- var state = _ref.state,
1017
- options = _ref.options,
1018
- name = _ref.name;
1019
-
1020
- if (state.modifiersData[name]._skip) {
1021
- return;
1022
- }
1023
-
1024
- var _options$mainAxis = options.mainAxis,
1025
- checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
1026
- _options$altAxis = options.altAxis,
1027
- checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,
1028
- specifiedFallbackPlacements = options.fallbackPlacements,
1029
- padding = options.padding,
1030
- boundary = options.boundary,
1031
- rootBoundary = options.rootBoundary,
1032
- altBoundary = options.altBoundary,
1033
- _options$flipVariatio = options.flipVariations,
1034
- flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,
1035
- allowedAutoPlacements = options.allowedAutoPlacements;
1036
- var preferredPlacement = state.options.placement;
1037
- var basePlacement = getBasePlacement(preferredPlacement);
1038
- var isBasePlacement = basePlacement === preferredPlacement;
1039
- var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));
1040
- var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {
1041
- return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {
1042
- placement: placement,
1043
- boundary: boundary,
1044
- rootBoundary: rootBoundary,
1045
- padding: padding,
1046
- flipVariations: flipVariations,
1047
- allowedAutoPlacements: allowedAutoPlacements
1048
- }) : placement);
1049
- }, []);
1050
- var referenceRect = state.rects.reference;
1051
- var popperRect = state.rects.popper;
1052
- var checksMap = new Map();
1053
- var makeFallbackChecks = true;
1054
- var firstFittingPlacement = placements[0];
1055
-
1056
- for (var i = 0; i < placements.length; i++) {
1057
- var placement = placements[i];
1058
-
1059
- var _basePlacement = getBasePlacement(placement);
1060
-
1061
- var isStartVariation = getVariation(placement) === start;
1062
- var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;
1063
- var len = isVertical ? 'width' : 'height';
1064
- var overflow = detectOverflow(state, {
1065
- placement: placement,
1066
- boundary: boundary,
1067
- rootBoundary: rootBoundary,
1068
- altBoundary: altBoundary,
1069
- padding: padding
1070
- });
1071
- var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;
1072
-
1073
- if (referenceRect[len] > popperRect[len]) {
1074
- mainVariationSide = getOppositePlacement(mainVariationSide);
1075
- }
1076
-
1077
- var altVariationSide = getOppositePlacement(mainVariationSide);
1078
- var checks = [];
1079
-
1080
- if (checkMainAxis) {
1081
- checks.push(overflow[_basePlacement] <= 0);
1082
- }
1083
-
1084
- if (checkAltAxis) {
1085
- checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);
1086
- }
1087
-
1088
- if (checks.every(function (check) {
1089
- return check;
1090
- })) {
1091
- firstFittingPlacement = placement;
1092
- makeFallbackChecks = false;
1093
- break;
1094
- }
1095
-
1096
- checksMap.set(placement, checks);
1097
- }
1098
-
1099
- if (makeFallbackChecks) {
1100
- // `2` may be desired in some cases – research later
1101
- var numberOfChecks = flipVariations ? 3 : 1;
1102
-
1103
- var _loop = function _loop(_i) {
1104
- var fittingPlacement = placements.find(function (placement) {
1105
- var checks = checksMap.get(placement);
1106
-
1107
- if (checks) {
1108
- return checks.slice(0, _i).every(function (check) {
1109
- return check;
1110
- });
1111
- }
1112
- });
1113
-
1114
- if (fittingPlacement) {
1115
- firstFittingPlacement = fittingPlacement;
1116
- return "break";
1117
- }
1118
- };
1119
-
1120
- for (var _i = numberOfChecks; _i > 0; _i--) {
1121
- var _ret = _loop(_i);
1122
-
1123
- if (_ret === "break") break;
1124
- }
1125
- }
1126
-
1127
- if (state.placement !== firstFittingPlacement) {
1128
- state.modifiersData[name]._skip = true;
1129
- state.placement = firstFittingPlacement;
1130
- state.reset = true;
1131
- }
1132
- } // eslint-disable-next-line import/no-unused-modules
1133
-
1134
-
1135
- const flip$1 = {
1136
- name: 'flip',
1137
- enabled: true,
1138
- phase: 'main',
1139
- fn: flip,
1140
- requiresIfExists: ['offset'],
1141
- data: {
1142
- _skip: false
1143
- }
1144
- };
1145
-
1146
- function getSideOffsets(overflow, rect, preventedOffsets) {
1147
- if (preventedOffsets === void 0) {
1148
- preventedOffsets = {
1149
- x: 0,
1150
- y: 0
1151
- };
1152
- }
1153
-
1154
- return {
1155
- top: overflow.top - rect.height - preventedOffsets.y,
1156
- right: overflow.right - rect.width + preventedOffsets.x,
1157
- bottom: overflow.bottom - rect.height + preventedOffsets.y,
1158
- left: overflow.left - rect.width - preventedOffsets.x
1159
- };
1160
- }
1161
-
1162
- function isAnySideFullyClipped(overflow) {
1163
- return [top, right, bottom, left].some(function (side) {
1164
- return overflow[side] >= 0;
1165
- });
1166
- }
1167
-
1168
- function hide(_ref) {
1169
- var state = _ref.state,
1170
- name = _ref.name;
1171
- var referenceRect = state.rects.reference;
1172
- var popperRect = state.rects.popper;
1173
- var preventedOffsets = state.modifiersData.preventOverflow;
1174
- var referenceOverflow = detectOverflow(state, {
1175
- elementContext: 'reference'
1176
- });
1177
- var popperAltOverflow = detectOverflow(state, {
1178
- altBoundary: true
1179
- });
1180
- var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);
1181
- var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);
1182
- var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);
1183
- var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);
1184
- state.modifiersData[name] = {
1185
- referenceClippingOffsets: referenceClippingOffsets,
1186
- popperEscapeOffsets: popperEscapeOffsets,
1187
- isReferenceHidden: isReferenceHidden,
1188
- hasPopperEscaped: hasPopperEscaped
1189
- };
1190
- state.attributes.popper = Object.assign({}, state.attributes.popper, {
1191
- 'data-popper-reference-hidden': isReferenceHidden,
1192
- 'data-popper-escaped': hasPopperEscaped
1193
- });
1194
- } // eslint-disable-next-line import/no-unused-modules
1195
-
1196
-
1197
- const hide$1 = {
1198
- name: 'hide',
1199
- enabled: true,
1200
- phase: 'main',
1201
- requiresIfExists: ['preventOverflow'],
1202
- fn: hide
1203
- };
1204
-
1205
- function distanceAndSkiddingToXY(placement, rects, offset) {
1206
- var basePlacement = getBasePlacement(placement);
1207
- var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;
1208
-
1209
- var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {
1210
- placement: placement
1211
- })) : offset,
1212
- skidding = _ref[0],
1213
- distance = _ref[1];
1214
-
1215
- skidding = skidding || 0;
1216
- distance = (distance || 0) * invertDistance;
1217
- return [left, right].indexOf(basePlacement) >= 0 ? {
1218
- x: distance,
1219
- y: skidding
1220
- } : {
1221
- x: skidding,
1222
- y: distance
1223
- };
1224
- }
1225
-
1226
- function offset(_ref2) {
1227
- var state = _ref2.state,
1228
- options = _ref2.options,
1229
- name = _ref2.name;
1230
- var _options$offset = options.offset,
1231
- offset = _options$offset === void 0 ? [0, 0] : _options$offset;
1232
- var data = placements.reduce(function (acc, placement) {
1233
- acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);
1234
- return acc;
1235
- }, {});
1236
- var _data$state$placement = data[state.placement],
1237
- x = _data$state$placement.x,
1238
- y = _data$state$placement.y;
1239
-
1240
- if (state.modifiersData.popperOffsets != null) {
1241
- state.modifiersData.popperOffsets.x += x;
1242
- state.modifiersData.popperOffsets.y += y;
1243
- }
1244
-
1245
- state.modifiersData[name] = data;
1246
- } // eslint-disable-next-line import/no-unused-modules
1247
-
1248
-
1249
- const offset$1 = {
1250
- name: 'offset',
1251
- enabled: true,
1252
- phase: 'main',
1253
- requires: ['popperOffsets'],
1254
- fn: offset
1255
- };
1256
-
1257
- function popperOffsets(_ref) {
1258
- var state = _ref.state,
1259
- name = _ref.name;
1260
- // Offsets are the actual position the popper needs to have to be
1261
- // properly positioned near its reference element
1262
- // This is the most basic placement, and will be adjusted by
1263
- // the modifiers in the next step
1264
- state.modifiersData[name] = computeOffsets({
1265
- reference: state.rects.reference,
1266
- element: state.rects.popper,
1267
- strategy: 'absolute',
1268
- placement: state.placement
1269
- });
1270
- } // eslint-disable-next-line import/no-unused-modules
1271
-
1272
-
1273
- const popperOffsets$1 = {
1274
- name: 'popperOffsets',
1275
- enabled: true,
1276
- phase: 'read',
1277
- fn: popperOffsets,
1278
- data: {}
1279
- };
1280
-
1281
- function getAltAxis(axis) {
1282
- return axis === 'x' ? 'y' : 'x';
1283
- }
1284
-
1285
- function preventOverflow(_ref) {
1286
- var state = _ref.state,
1287
- options = _ref.options,
1288
- name = _ref.name;
1289
- var _options$mainAxis = options.mainAxis,
1290
- checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
1291
- _options$altAxis = options.altAxis,
1292
- checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,
1293
- boundary = options.boundary,
1294
- rootBoundary = options.rootBoundary,
1295
- altBoundary = options.altBoundary,
1296
- padding = options.padding,
1297
- _options$tether = options.tether,
1298
- tether = _options$tether === void 0 ? true : _options$tether,
1299
- _options$tetherOffset = options.tetherOffset,
1300
- tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;
1301
- var overflow = detectOverflow(state, {
1302
- boundary: boundary,
1303
- rootBoundary: rootBoundary,
1304
- padding: padding,
1305
- altBoundary: altBoundary
1306
- });
1307
- var basePlacement = getBasePlacement(state.placement);
1308
- var variation = getVariation(state.placement);
1309
- var isBasePlacement = !variation;
1310
- var mainAxis = getMainAxisFromPlacement(basePlacement);
1311
- var altAxis = getAltAxis(mainAxis);
1312
- var popperOffsets = state.modifiersData.popperOffsets;
1313
- var referenceRect = state.rects.reference;
1314
- var popperRect = state.rects.popper;
1315
- var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {
1316
- placement: state.placement
1317
- })) : tetherOffset;
1318
- var data = {
1319
- x: 0,
1320
- y: 0
1321
- };
1322
-
1323
- if (!popperOffsets) {
1324
- return;
1325
- }
1326
-
1327
- if (checkMainAxis || checkAltAxis) {
1328
- var mainSide = mainAxis === 'y' ? top : left;
1329
- var altSide = mainAxis === 'y' ? bottom : right;
1330
- var len = mainAxis === 'y' ? 'height' : 'width';
1331
- var offset = popperOffsets[mainAxis];
1332
- var min$1 = popperOffsets[mainAxis] + overflow[mainSide];
1333
- var max$1 = popperOffsets[mainAxis] - overflow[altSide];
1334
- var additive = tether ? -popperRect[len] / 2 : 0;
1335
- var minLen = variation === start ? referenceRect[len] : popperRect[len];
1336
- var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go
1337
- // outside the reference bounds
1338
-
1339
- var arrowElement = state.elements.arrow;
1340
- var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {
1341
- width: 0,
1342
- height: 0
1343
- };
1344
- var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();
1345
- var arrowPaddingMin = arrowPaddingObject[mainSide];
1346
- var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want
1347
- // to include its full size in the calculation. If the reference is small
1348
- // and near the edge of a boundary, the popper can overflow even if the
1349
- // reference is not overflowing as well (e.g. virtual elements with no
1350
- // width or height)
1351
-
1352
- var arrowLen = within(0, referenceRect[len], arrowRect[len]);
1353
- var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - tetherOffsetValue : minLen - arrowLen - arrowPaddingMin - tetherOffsetValue;
1354
- var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + tetherOffsetValue : maxLen + arrowLen + arrowPaddingMax + tetherOffsetValue;
1355
- var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
1356
- var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
1357
- var offsetModifierValue = state.modifiersData.offset ? state.modifiersData.offset[state.placement][mainAxis] : 0;
1358
- var tetherMin = popperOffsets[mainAxis] + minOffset - offsetModifierValue - clientOffset;
1359
- var tetherMax = popperOffsets[mainAxis] + maxOffset - offsetModifierValue;
1360
-
1361
- if (checkMainAxis) {
1362
- var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset, tether ? max(max$1, tetherMax) : max$1);
1363
- popperOffsets[mainAxis] = preventedOffset;
1364
- data[mainAxis] = preventedOffset - offset;
1365
- }
1366
-
1367
- if (checkAltAxis) {
1368
- var _mainSide = mainAxis === 'x' ? top : left;
1369
-
1370
- var _altSide = mainAxis === 'x' ? bottom : right;
1371
-
1372
- var _offset = popperOffsets[altAxis];
1373
-
1374
- var _min = _offset + overflow[_mainSide];
1375
-
1376
- var _max = _offset - overflow[_altSide];
1377
-
1378
- var _preventedOffset = within(tether ? min(_min, tetherMin) : _min, _offset, tether ? max(_max, tetherMax) : _max);
1379
-
1380
- popperOffsets[altAxis] = _preventedOffset;
1381
- data[altAxis] = _preventedOffset - _offset;
1382
- }
1383
- }
1384
-
1385
- state.modifiersData[name] = data;
1386
- } // eslint-disable-next-line import/no-unused-modules
1387
-
1388
-
1389
- const preventOverflow$1 = {
1390
- name: 'preventOverflow',
1391
- enabled: true,
1392
- phase: 'main',
1393
- fn: preventOverflow,
1394
- requiresIfExists: ['offset']
1395
- };
1396
-
1397
- function getHTMLElementScroll(element) {
1398
- return {
1399
- scrollLeft: element.scrollLeft,
1400
- scrollTop: element.scrollTop
1401
- };
1402
- }
1403
-
1404
- function getNodeScroll(node) {
1405
- if (node === getWindow(node) || !isHTMLElement(node)) {
1406
- return getWindowScroll(node);
1407
- } else {
1408
- return getHTMLElementScroll(node);
1409
- }
1410
- }
1411
-
1412
- function isElementScaled(element) {
1413
- var rect = element.getBoundingClientRect();
1414
- var scaleX = rect.width / element.offsetWidth || 1;
1415
- var scaleY = rect.height / element.offsetHeight || 1;
1416
- return scaleX !== 1 || scaleY !== 1;
1417
- } // Returns the composite rect of an element relative to its offsetParent.
1418
- // Composite means it takes into account transforms as well as layout.
1419
-
1420
-
1421
- function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
1422
- if (isFixed === void 0) {
1423
- isFixed = false;
1424
- }
1425
-
1426
- var isOffsetParentAnElement = isHTMLElement(offsetParent);
1427
- var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
1428
- var documentElement = getDocumentElement(offsetParent);
1429
- var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled);
1430
- var scroll = {
1431
- scrollLeft: 0,
1432
- scrollTop: 0
1433
- };
1434
- var offsets = {
1435
- x: 0,
1436
- y: 0
1437
- };
1438
-
1439
- if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
1440
- if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078
1441
- isScrollParent(documentElement)) {
1442
- scroll = getNodeScroll(offsetParent);
1443
- }
1444
-
1445
- if (isHTMLElement(offsetParent)) {
1446
- offsets = getBoundingClientRect(offsetParent, true);
1447
- offsets.x += offsetParent.clientLeft;
1448
- offsets.y += offsetParent.clientTop;
1449
- } else if (documentElement) {
1450
- offsets.x = getWindowScrollBarX(documentElement);
1451
- }
1452
- }
1453
-
1454
- return {
1455
- x: rect.left + scroll.scrollLeft - offsets.x,
1456
- y: rect.top + scroll.scrollTop - offsets.y,
1457
- width: rect.width,
1458
- height: rect.height
1459
- };
1460
- }
1461
-
1462
- function order(modifiers) {
1463
- var map = new Map();
1464
- var visited = new Set();
1465
- var result = [];
1466
- modifiers.forEach(function (modifier) {
1467
- map.set(modifier.name, modifier);
1468
- }); // On visiting object, check for its dependencies and visit them recursively
1469
-
1470
- function sort(modifier) {
1471
- visited.add(modifier.name);
1472
- var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);
1473
- requires.forEach(function (dep) {
1474
- if (!visited.has(dep)) {
1475
- var depModifier = map.get(dep);
1476
-
1477
- if (depModifier) {
1478
- sort(depModifier);
1479
- }
1480
- }
1481
- });
1482
- result.push(modifier);
1483
- }
1484
-
1485
- modifiers.forEach(function (modifier) {
1486
- if (!visited.has(modifier.name)) {
1487
- // check for visited object
1488
- sort(modifier);
1489
- }
1490
- });
1491
- return result;
1492
- }
1493
-
1494
- function orderModifiers(modifiers) {
1495
- // order based on dependencies
1496
- var orderedModifiers = order(modifiers); // order based on phase
1497
-
1498
- return modifierPhases.reduce(function (acc, phase) {
1499
- return acc.concat(orderedModifiers.filter(function (modifier) {
1500
- return modifier.phase === phase;
1501
- }));
1502
- }, []);
1503
- }
1504
-
1505
- function debounce(fn) {
1506
- var pending;
1507
- return function () {
1508
- if (!pending) {
1509
- pending = new Promise(function (resolve) {
1510
- Promise.resolve().then(function () {
1511
- pending = undefined;
1512
- resolve(fn());
1513
- });
1514
- });
1515
- }
1516
-
1517
- return pending;
1518
- };
1519
- }
1520
-
1521
- function mergeByName(modifiers) {
1522
- var merged = modifiers.reduce(function (merged, current) {
1523
- var existing = merged[current.name];
1524
- merged[current.name] = existing ? Object.assign({}, existing, current, {
1525
- options: Object.assign({}, existing.options, current.options),
1526
- data: Object.assign({}, existing.data, current.data)
1527
- }) : current;
1528
- return merged;
1529
- }, {}); // IE11 does not support Object.values
1530
-
1531
- return Object.keys(merged).map(function (key) {
1532
- return merged[key];
1533
- });
1534
- }
1535
-
1536
- var DEFAULT_OPTIONS = {
1537
- placement: 'bottom',
1538
- modifiers: [],
1539
- strategy: 'absolute'
1540
- };
1541
-
1542
- function areValidElements() {
1543
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1544
- args[_key] = arguments[_key];
1545
- }
1546
-
1547
- return !args.some(function (element) {
1548
- return !(element && typeof element.getBoundingClientRect === 'function');
1549
- });
1550
- }
1551
-
1552
- function popperGenerator(generatorOptions) {
1553
- if (generatorOptions === void 0) {
1554
- generatorOptions = {};
1555
- }
1556
-
1557
- var _generatorOptions = generatorOptions,
1558
- _generatorOptions$def = _generatorOptions.defaultModifiers,
1559
- defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,
1560
- _generatorOptions$def2 = _generatorOptions.defaultOptions,
1561
- defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;
1562
- return function createPopper(reference, popper, options) {
1563
- if (options === void 0) {
1564
- options = defaultOptions;
1565
- }
1566
-
1567
- var state = {
1568
- placement: 'bottom',
1569
- orderedModifiers: [],
1570
- options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),
1571
- modifiersData: {},
1572
- elements: {
1573
- reference: reference,
1574
- popper: popper
1575
- },
1576
- attributes: {},
1577
- styles: {}
1578
- };
1579
- var effectCleanupFns = [];
1580
- var isDestroyed = false;
1581
- var instance = {
1582
- state: state,
1583
- setOptions: function setOptions(options) {
1584
- cleanupModifierEffects();
1585
- state.options = Object.assign({}, defaultOptions, state.options, options);
1586
- state.scrollParents = {
1587
- reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],
1588
- popper: listScrollParents(popper)
1589
- }; // Orders the modifiers based on their dependencies and `phase`
1590
- // properties
1591
-
1592
- var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers
1593
-
1594
- state.orderedModifiers = orderedModifiers.filter(function (m) {
1595
- return m.enabled;
1596
- }); // Validate the provided modifiers so that the consumer will get warned
1597
-
1598
- runModifierEffects();
1599
- return instance.update();
1600
- },
1601
- // Sync update – it will always be executed, even if not necessary. This
1602
- // is useful for low frequency updates where sync behavior simplifies the
1603
- // logic.
1604
- // For high frequency updates (e.g. `resize` and `scroll` events), always
1605
- // prefer the async Popper#update method
1606
- forceUpdate: function forceUpdate() {
1607
- if (isDestroyed) {
1608
- return;
1609
- }
1610
-
1611
- var _state$elements = state.elements,
1612
- reference = _state$elements.reference,
1613
- popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements
1614
- // anymore
1615
-
1616
- if (!areValidElements(reference, popper)) {
1617
-
1618
- return;
1619
- } // Store the reference and popper rects to be read by modifiers
1620
-
1621
-
1622
- state.rects = {
1623
- reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),
1624
- popper: getLayoutRect(popper)
1625
- }; // Modifiers have the ability to reset the current update cycle. The
1626
- // most common use case for this is the `flip` modifier changing the
1627
- // placement, which then needs to re-run all the modifiers, because the
1628
- // logic was previously ran for the previous placement and is therefore
1629
- // stale/incorrect
1630
-
1631
- state.reset = false;
1632
- state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier
1633
- // is filled with the initial data specified by the modifier. This means
1634
- // it doesn't persist and is fresh on each update.
1635
- // To ensure persistent data, use `${name}#persistent`
1636
-
1637
- state.orderedModifiers.forEach(function (modifier) {
1638
- return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
1639
- });
1640
-
1641
- for (var index = 0; index < state.orderedModifiers.length; index++) {
1642
-
1643
- if (state.reset === true) {
1644
- state.reset = false;
1645
- index = -1;
1646
- continue;
1647
- }
1648
-
1649
- var _state$orderedModifie = state.orderedModifiers[index],
1650
- fn = _state$orderedModifie.fn,
1651
- _state$orderedModifie2 = _state$orderedModifie.options,
1652
- _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,
1653
- name = _state$orderedModifie.name;
1654
-
1655
- if (typeof fn === 'function') {
1656
- state = fn({
1657
- state: state,
1658
- options: _options,
1659
- name: name,
1660
- instance: instance
1661
- }) || state;
1662
- }
1663
- }
1664
- },
1665
- // Async and optimistically optimized update – it will not be executed if
1666
- // not necessary (debounced to run at most once-per-tick)
1667
- update: debounce(function () {
1668
- return new Promise(function (resolve) {
1669
- instance.forceUpdate();
1670
- resolve(state);
1671
- });
1672
- }),
1673
- destroy: function destroy() {
1674
- cleanupModifierEffects();
1675
- isDestroyed = true;
1676
- }
1677
- };
1678
-
1679
- if (!areValidElements(reference, popper)) {
1680
-
1681
- return instance;
1682
- }
1683
-
1684
- instance.setOptions(options).then(function (state) {
1685
- if (!isDestroyed && options.onFirstUpdate) {
1686
- options.onFirstUpdate(state);
1687
- }
1688
- }); // Modifiers have the ability to execute arbitrary code before the first
1689
- // update cycle runs. They will be executed in the same order as the update
1690
- // cycle. This is useful when a modifier adds some persistent data that
1691
- // other modifiers need to use, but the modifier is run after the dependent
1692
- // one.
1693
-
1694
- function runModifierEffects() {
1695
- state.orderedModifiers.forEach(function (_ref3) {
1696
- var name = _ref3.name,
1697
- _ref3$options = _ref3.options,
1698
- options = _ref3$options === void 0 ? {} : _ref3$options,
1699
- effect = _ref3.effect;
1700
-
1701
- if (typeof effect === 'function') {
1702
- var cleanupFn = effect({
1703
- state: state,
1704
- name: name,
1705
- instance: instance,
1706
- options: options
1707
- });
1708
-
1709
- var noopFn = function noopFn() {};
1710
-
1711
- effectCleanupFns.push(cleanupFn || noopFn);
1712
- }
1713
- });
1714
- }
1715
-
1716
- function cleanupModifierEffects() {
1717
- effectCleanupFns.forEach(function (fn) {
1718
- return fn();
1719
- });
1720
- effectCleanupFns = [];
1721
- }
1722
-
1723
- return instance;
1724
- };
1725
- }
1726
-
1727
- var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$1, flip$1, preventOverflow$1, arrow$1, hide$1];
1728
- var createPopper = /*#__PURE__*/popperGenerator({
1729
- defaultModifiers: defaultModifiers
1730
- }); // eslint-disable-next-line import/no-unused-modules
2
+ import { a as clickInsideElement } from './helpers-e2993152.js';
3
+ import { c as createPopper } from './popper-e5fdfb6a.js';
1731
4
 
1732
5
  const galacticMenuCss = "#menu{background-color:var(--wcs-gray);color:white;display:none;padding:var(--wcs-padding)}#menu[data-show]{display:block;z-index:9999}#menu[data-popper-placement^=top]>#arrow{bottom:-4px}#menu[data-popper-placement^=bottom]>#arrow{top:-4px}#menu[data-popper-placement^=left]>#arrow{right:-4px}#menu[data-popper-placement^=right]>#arrow{left:-4px}:host{display:flex;align-items:center;height:32px;padding-left:var(--wcs-padding);background-color:var(--wcs-gray-light)}#toggle-menu-icon{cursor:pointer;padding:0 var(--wcs-padding);user-select:none}#arrow,#arrow::before{position:absolute;width:8px;height:8px;background:inherit}#arrow{visibility:hidden}#arrow::before{visibility:visible;content:\"\";transform:rotate(45deg)}";
1733
6