@react-aria/overlays 3.7.3 → 3.8.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.
package/dist/main.js CHANGED
@@ -1,686 +1,531 @@
1
- var {
2
- VisuallyHidden
3
- } = require("@react-aria/visually-hidden");
4
-
5
- var _babelRuntimeHelpersInteropRequireDefault = $parcel$interopDefault(require("@babel/runtime/helpers/interopRequireDefault"));
6
-
7
- var _reactDom = $parcel$interopDefault(require("react-dom"));
8
-
9
- var _babelRuntimeHelpersObjectWithoutPropertiesLoose = $parcel$interopDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
10
-
11
- var {
12
- useFocusWithin,
13
- useInteractOutside
14
- } = require("@react-aria/interactions");
15
-
16
- var {
17
- useLocale,
18
- useMessageFormatter
19
- } = require("@react-aria/i18n");
20
-
21
- var {
22
- useLayoutEffect,
23
- useId,
24
- chain,
25
- getScrollParent,
26
- isIOS
27
- } = require("@react-aria/utils");
28
-
29
- var _react2 = require("react");
30
-
31
- var _react = $parcel$interopDefault(_react2);
1
+ var $6Zb2x$react = require("react");
2
+ var $6Zb2x$reactariautils = require("@react-aria/utils");
3
+ var $6Zb2x$reactariai18n = require("@react-aria/i18n");
4
+ var $6Zb2x$domhelpersstyle = require("dom-helpers/style");
5
+ var $6Zb2x$domhelpersqueryoffset = require("dom-helpers/query/offset");
6
+ var $6Zb2x$domhelpersqueryposition = require("dom-helpers/query/position");
7
+ var $6Zb2x$domhelpersqueryscrollLeft = require("dom-helpers/query/scrollLeft");
8
+ var $6Zb2x$domhelpersqueryscrollTop = require("dom-helpers/query/scrollTop");
9
+ var $6Zb2x$domhelpersownerDocument = require("dom-helpers/ownerDocument");
10
+ var $6Zb2x$reactariainteractions = require("@react-aria/interactions");
11
+ var $6Zb2x$reactdom = require("react-dom");
12
+ var $6Zb2x$reactariavisuallyhidden = require("@react-aria/visually-hidden");
13
+
14
+ function $parcel$exportWildcard(dest, source) {
15
+ Object.keys(source).forEach(function(key) {
16
+ if (key === 'default' || key === '__esModule' || dest.hasOwnProperty(key)) {
17
+ return;
18
+ }
32
19
 
33
- var {
34
- useCallback,
35
- useRef,
36
- useState,
37
- useEffect,
38
- useContext,
39
- useMemo
40
- } = _react2;
20
+ Object.defineProperty(dest, key, {
21
+ enumerable: true,
22
+ get: function get() {
23
+ return source[key];
24
+ }
25
+ });
26
+ });
41
27
 
42
- var _domHelpersOwnerDocument = $parcel$interopDefault(require("dom-helpers/ownerDocument"));
28
+ return dest;
29
+ }
30
+ function $parcel$export(e, n, v, s) {
31
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
32
+ }
33
+ function $parcel$interopDefault(a) {
34
+ return a && a.__esModule ? a.default : a;
35
+ }
36
+ var $cd94b4896dd97759$exports = {};
43
37
 
44
- var _domHelpersQueryScrollTop = $parcel$interopDefault(require("dom-helpers/query/scrollTop"));
38
+ $parcel$export($cd94b4896dd97759$exports, "useOverlayPosition", () => $cd94b4896dd97759$export$d39e1813b3bdd0e1);
45
39
 
46
- var _domHelpersQueryScrollLeft = $parcel$interopDefault(require("dom-helpers/query/scrollLeft"));
47
40
 
48
- var _domHelpersQueryPosition = $parcel$interopDefault(require("dom-helpers/query/position"));
49
41
 
50
- var _domHelpersQueryOffset = $parcel$interopDefault(require("dom-helpers/query/offset"));
51
42
 
52
- var _domHelpersStyle = $parcel$interopDefault(require("dom-helpers/style"));
53
43
 
54
- var _babelRuntimeHelpersExtends = $parcel$interopDefault(require("@babel/runtime/helpers/extends"));
55
44
 
56
- function $parcel$interopDefault(a) {
57
- return a && a.__esModule ? a.default : a;
58
- }
59
-
60
- const $c13020473a0fe27b1a1c4797269d1704$var$AXIS = {
61
- top: 'top',
62
- bottom: 'top',
63
- left: 'left',
64
- right: 'left'
45
+ const $5935ba4d7da2c103$var$AXIS = {
46
+ top: 'top',
47
+ bottom: 'top',
48
+ left: 'left',
49
+ right: 'left'
65
50
  };
66
- const $c13020473a0fe27b1a1c4797269d1704$var$FLIPPED_DIRECTION = {
67
- top: 'bottom',
68
- bottom: 'top',
69
- left: 'right',
70
- right: 'left'
51
+ const $5935ba4d7da2c103$var$FLIPPED_DIRECTION = {
52
+ top: 'bottom',
53
+ bottom: 'top',
54
+ left: 'right',
55
+ right: 'left'
71
56
  };
72
- const $c13020473a0fe27b1a1c4797269d1704$var$CROSS_AXIS = {
73
- top: 'left',
74
- left: 'top'
57
+ const $5935ba4d7da2c103$var$CROSS_AXIS = {
58
+ top: 'left',
59
+ left: 'top'
75
60
  };
76
- const $c13020473a0fe27b1a1c4797269d1704$var$AXIS_SIZE = {
77
- top: 'height',
78
- left: 'width'
61
+ const $5935ba4d7da2c103$var$AXIS_SIZE = {
62
+ top: 'height',
63
+ left: 'width'
79
64
  };
80
- const $c13020473a0fe27b1a1c4797269d1704$var$PARSED_PLACEMENT_CACHE = {}; // @ts-ignore
81
-
82
- let $c13020473a0fe27b1a1c4797269d1704$var$visualViewport = typeof window !== 'undefined' && window.visualViewport;
83
-
84
- function $c13020473a0fe27b1a1c4797269d1704$var$getContainerDimensions(containerNode) {
85
- let width = 0,
86
- height = 0,
87
- top = 0,
88
- left = 0;
89
- let scroll = {};
90
-
91
- if (containerNode.tagName === 'BODY') {
92
- var _visualViewport$width, _visualViewport$heigh;
93
-
94
- width = (_visualViewport$width = $c13020473a0fe27b1a1c4797269d1704$var$visualViewport == null ? void 0 : $c13020473a0fe27b1a1c4797269d1704$var$visualViewport.width) != null ? _visualViewport$width : document.documentElement.clientWidth;
95
- height = (_visualViewport$heigh = $c13020473a0fe27b1a1c4797269d1704$var$visualViewport == null ? void 0 : $c13020473a0fe27b1a1c4797269d1704$var$visualViewport.height) != null ? _visualViewport$heigh : document.documentElement.clientHeight;
96
- scroll.top = _domHelpersQueryScrollTop(_domHelpersOwnerDocument(containerNode).documentElement) || _domHelpersQueryScrollTop(containerNode);
97
- scroll.left = _domHelpersQueryScrollLeft(_domHelpersOwnerDocument(containerNode).documentElement) || _domHelpersQueryScrollLeft(containerNode);
98
- } else {
99
- ({
100
- width,
101
- height,
102
- top,
103
- left
104
- } = _domHelpersQueryOffset(containerNode));
105
- scroll.top = _domHelpersQueryScrollTop(containerNode);
106
- scroll.left = _domHelpersQueryScrollLeft(containerNode);
107
- }
108
-
109
- return {
110
- width,
111
- height,
112
- scroll,
113
- top,
114
- left
115
- };
65
+ const $5935ba4d7da2c103$var$PARSED_PLACEMENT_CACHE = {
66
+ };
67
+ // @ts-ignore
68
+ let $5935ba4d7da2c103$var$visualViewport = typeof window !== 'undefined' && window.visualViewport;
69
+ function $5935ba4d7da2c103$var$getContainerDimensions(containerNode) {
70
+ let width = 0, height = 0, top = 0, left = 0;
71
+ let scroll = {
72
+ };
73
+ if (containerNode.tagName === 'BODY') {
74
+ var ref;
75
+ width = (ref = $5935ba4d7da2c103$var$visualViewport === null || $5935ba4d7da2c103$var$visualViewport === void 0 ? void 0 : $5935ba4d7da2c103$var$visualViewport.width) !== null && ref !== void 0 ? ref : document.documentElement.clientWidth;
76
+ var ref1;
77
+ height = (ref1 = $5935ba4d7da2c103$var$visualViewport === null || $5935ba4d7da2c103$var$visualViewport === void 0 ? void 0 : $5935ba4d7da2c103$var$visualViewport.height) !== null && ref1 !== void 0 ? ref1 : document.documentElement.clientHeight;
78
+ scroll.top = ($parcel$interopDefault($6Zb2x$domhelpersqueryscrollTop))(($parcel$interopDefault($6Zb2x$domhelpersownerDocument))(containerNode).documentElement) || ($parcel$interopDefault($6Zb2x$domhelpersqueryscrollTop))(containerNode);
79
+ scroll.left = ($parcel$interopDefault($6Zb2x$domhelpersqueryscrollLeft))(($parcel$interopDefault($6Zb2x$domhelpersownerDocument))(containerNode).documentElement) || ($parcel$interopDefault($6Zb2x$domhelpersqueryscrollLeft))(containerNode);
80
+ } else {
81
+ ({ width: width , height: height , top: top , left: left } = ($parcel$interopDefault($6Zb2x$domhelpersqueryoffset))(containerNode));
82
+ scroll.top = ($parcel$interopDefault($6Zb2x$domhelpersqueryscrollTop))(containerNode);
83
+ scroll.left = ($parcel$interopDefault($6Zb2x$domhelpersqueryscrollLeft))(containerNode);
84
+ }
85
+ return {
86
+ width: width,
87
+ height: height,
88
+ scroll: scroll,
89
+ top: top,
90
+ left: left
91
+ };
116
92
  }
117
-
118
- function $c13020473a0fe27b1a1c4797269d1704$var$getScroll(node) {
119
- return {
120
- top: node.scrollTop,
121
- left: node.scrollLeft,
122
- width: node.scrollWidth,
123
- height: node.scrollHeight
124
- };
93
+ function $5935ba4d7da2c103$var$getScroll(node) {
94
+ return {
95
+ top: node.scrollTop,
96
+ left: node.scrollLeft,
97
+ width: node.scrollWidth,
98
+ height: node.scrollHeight
99
+ };
125
100
  }
126
-
127
- function $c13020473a0fe27b1a1c4797269d1704$var$getDelta(axis, offset, size, containerDimensions, padding) {
128
- let containerScroll = containerDimensions.scroll[axis];
129
- let containerHeight = containerDimensions[$c13020473a0fe27b1a1c4797269d1704$var$AXIS_SIZE[axis]];
130
- let startEdgeOffset = offset - padding - containerScroll;
131
- let endEdgeOffset = offset + padding - containerScroll + size;
132
-
133
- if (startEdgeOffset < 0) {
134
- return -startEdgeOffset;
135
- } else if (endEdgeOffset > containerHeight) {
136
- return Math.max(containerHeight - endEdgeOffset, -startEdgeOffset);
137
- } else {
138
- return 0;
139
- }
101
+ function $5935ba4d7da2c103$var$getDelta(axis, offset, size, containerDimensions, padding) {
102
+ let containerScroll = containerDimensions.scroll[axis];
103
+ let containerHeight = containerDimensions[$5935ba4d7da2c103$var$AXIS_SIZE[axis]];
104
+ let startEdgeOffset = offset - padding - containerScroll;
105
+ let endEdgeOffset = offset + padding - containerScroll + size;
106
+ if (startEdgeOffset < 0) return -startEdgeOffset;
107
+ else if (endEdgeOffset > containerHeight) return Math.max(containerHeight - endEdgeOffset, -startEdgeOffset);
108
+ else return 0;
140
109
  }
141
-
142
- function $c13020473a0fe27b1a1c4797269d1704$var$getMargins(node) {
143
- let style = window.getComputedStyle(node);
144
- return {
145
- top: parseInt(style.marginTop, 10) || 0,
146
- bottom: parseInt(style.marginBottom, 10) || 0,
147
- left: parseInt(style.marginLeft, 10) || 0,
148
- right: parseInt(style.marginRight, 10) || 0
149
- };
110
+ function $5935ba4d7da2c103$var$getMargins(node) {
111
+ let style = window.getComputedStyle(node);
112
+ return {
113
+ top: parseInt(style.marginTop, 10) || 0,
114
+ bottom: parseInt(style.marginBottom, 10) || 0,
115
+ left: parseInt(style.marginLeft, 10) || 0,
116
+ right: parseInt(style.marginRight, 10) || 0
117
+ };
150
118
  }
151
-
152
- function $c13020473a0fe27b1a1c4797269d1704$var$parsePlacement(input) {
153
- if ($c13020473a0fe27b1a1c4797269d1704$var$PARSED_PLACEMENT_CACHE[input]) {
154
- return $c13020473a0fe27b1a1c4797269d1704$var$PARSED_PLACEMENT_CACHE[input];
155
- }
156
-
157
- let [placement, crossPlacement] = input.split(' ');
158
- let axis = $c13020473a0fe27b1a1c4797269d1704$var$AXIS[placement] || 'right';
159
- let crossAxis = $c13020473a0fe27b1a1c4797269d1704$var$CROSS_AXIS[axis];
160
-
161
- if (!$c13020473a0fe27b1a1c4797269d1704$var$AXIS[crossPlacement]) {
162
- crossPlacement = 'center';
163
- }
164
-
165
- let size = $c13020473a0fe27b1a1c4797269d1704$var$AXIS_SIZE[axis];
166
- let crossSize = $c13020473a0fe27b1a1c4797269d1704$var$AXIS_SIZE[crossAxis];
167
- $c13020473a0fe27b1a1c4797269d1704$var$PARSED_PLACEMENT_CACHE[input] = {
168
- placement,
169
- crossPlacement,
170
- axis,
171
- crossAxis,
172
- size,
173
- crossSize
174
- };
175
- return $c13020473a0fe27b1a1c4797269d1704$var$PARSED_PLACEMENT_CACHE[input];
119
+ function $5935ba4d7da2c103$var$parsePlacement(input) {
120
+ if ($5935ba4d7da2c103$var$PARSED_PLACEMENT_CACHE[input]) return $5935ba4d7da2c103$var$PARSED_PLACEMENT_CACHE[input];
121
+ let [placement, crossPlacement] = input.split(' ');
122
+ let axis = $5935ba4d7da2c103$var$AXIS[placement] || 'right';
123
+ let crossAxis = $5935ba4d7da2c103$var$CROSS_AXIS[axis];
124
+ if (!$5935ba4d7da2c103$var$AXIS[crossPlacement]) crossPlacement = 'center';
125
+ let size = $5935ba4d7da2c103$var$AXIS_SIZE[axis];
126
+ let crossSize = $5935ba4d7da2c103$var$AXIS_SIZE[crossAxis];
127
+ $5935ba4d7da2c103$var$PARSED_PLACEMENT_CACHE[input] = {
128
+ placement: placement,
129
+ crossPlacement: crossPlacement,
130
+ axis: axis,
131
+ crossAxis: crossAxis,
132
+ size: size,
133
+ crossSize: crossSize
134
+ };
135
+ return $5935ba4d7da2c103$var$PARSED_PLACEMENT_CACHE[input];
176
136
  }
177
-
178
- function $c13020473a0fe27b1a1c4797269d1704$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned) {
179
- let {
180
- placement,
181
- crossPlacement,
182
- axis,
183
- crossAxis,
184
- size,
185
- crossSize
186
- } = placementInfo;
187
- let position = {}; // button position
188
-
189
- position[crossAxis] = childOffset[crossAxis];
190
-
191
- if (crossPlacement === 'center') {
192
- // + (button size / 2) - (overlay size / 2)
137
+ function $5935ba4d7da2c103$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned) {
138
+ let { placement: placement , crossPlacement: crossPlacement , axis: axis , crossAxis: crossAxis , size: size , crossSize: crossSize } = placementInfo;
139
+ let position = {
140
+ };
141
+ // button position
142
+ position[crossAxis] = childOffset[crossAxis];
143
+ if (crossPlacement === 'center') // + (button size / 2) - (overlay size / 2)
193
144
  // at this point the overlay center should match the button center
194
145
  position[crossAxis] += (childOffset[crossSize] - overlaySize[crossSize]) / 2;
195
- } else if (crossPlacement !== crossAxis) {
196
- // + (button size) - (overlay size)
146
+ else if (crossPlacement !== crossAxis) // + (button size) - (overlay size)
197
147
  // at this point the overlay bottom should match the button bottom
198
148
  position[crossAxis] += childOffset[crossSize] - overlaySize[crossSize];
199
- }
200
- /* else {
201
- the overlay top should match the button top
202
- } */
203
- // add the crossOffset from props
204
-
205
-
206
- position[crossAxis] += crossOffset; // this is button center position - the overlay size + half of the button to align bottom of overlay with button center
207
-
208
- let minViablePosition = childOffset[crossAxis] + childOffset[crossSize] / 2 - overlaySize[crossSize]; // this is button position of center, aligns top of overlay with button center
209
-
210
- let maxViablePosition = childOffset[crossAxis] + childOffset[crossSize] / 2; // clamp it into the range of the min/max positions
211
-
212
- position[crossAxis] = Math.min(Math.max(minViablePosition, position[crossAxis]), maxViablePosition); // Floor these so the position isn't placed on a partial pixel, only whole pixels. Shouldn't matter if it was floored or ceiled, so chose one.
213
-
214
- if (placement === axis) {
215
- // If the container is positioned (non-static), then we use the container's actual
216
- // height, as `bottom` will be relative to this height. But if the container is static,
217
- // then it can only be the `document.body`, and `bottom` will be relative to _its_
218
- // container, which should be as large as boundaryDimensions.
219
- const containerHeight = isContainerPositioned ? containerOffsetWithBoundary[size] : boundaryDimensions[size];
220
- position[$c13020473a0fe27b1a1c4797269d1704$var$FLIPPED_DIRECTION[axis]] = Math.floor(containerHeight - childOffset[axis] + offset);
221
- } else {
222
- position[axis] = Math.floor(childOffset[axis] + childOffset[size] + offset);
223
- }
224
-
225
- return position;
226
- }
227
-
228
- function $c13020473a0fe27b1a1c4797269d1704$var$getMaxHeight(position, boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding) {
229
- return position.top != null // We want the distance between the top of the overlay to the bottom of the boundary
230
- ? Math.max(0, boundaryDimensions.height + boundaryDimensions.top + boundaryDimensions.scroll.top - ( // this is the bottom of the boundary
231
- containerOffsetWithBoundary.top + position.top) // this is the top of the overlay
232
- - (margins.top + margins.bottom + padding) // save additional space for margin and padding
233
- ) // We want the distance between the top of the trigger to the top of the boundary
234
- : Math.max(0, childOffset.top + containerOffsetWithBoundary.top - ( // this is the top of the trigger
235
- boundaryDimensions.top + boundaryDimensions.scroll.top) // this is the top of the boundary
236
- - (margins.top + margins.bottom + padding) // save additional space for margin and padding
237
- );
149
+ /* else {
150
+ the overlay top should match the button top
151
+ } */
152
+ // add the crossOffset from props
153
+ position[crossAxis] += crossOffset;
154
+ // this is button center position - the overlay size + half of the button to align bottom of overlay with button center
155
+ let minViablePosition = childOffset[crossAxis] + childOffset[crossSize] / 2 - overlaySize[crossSize];
156
+ // this is button position of center, aligns top of overlay with button center
157
+ let maxViablePosition = childOffset[crossAxis] + childOffset[crossSize] / 2;
158
+ // clamp it into the range of the min/max positions
159
+ position[crossAxis] = Math.min(Math.max(minViablePosition, position[crossAxis]), maxViablePosition);
160
+ // Floor these so the position isn't placed on a partial pixel, only whole pixels. Shouldn't matter if it was floored or ceiled, so chose one.
161
+ if (placement === axis) {
162
+ // If the container is positioned (non-static), then we use the container's actual
163
+ // height, as `bottom` will be relative to this height. But if the container is static,
164
+ // then it can only be the `document.body`, and `bottom` will be relative to _its_
165
+ // container, which should be as large as boundaryDimensions.
166
+ const containerHeight = isContainerPositioned ? containerOffsetWithBoundary[size] : boundaryDimensions[size];
167
+ position[$5935ba4d7da2c103$var$FLIPPED_DIRECTION[axis]] = Math.floor(containerHeight - childOffset[axis] + offset);
168
+ } else position[axis] = Math.floor(childOffset[axis] + childOffset[size] + offset);
169
+ return position;
238
170
  }
239
-
240
- function $c13020473a0fe27b1a1c4797269d1704$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding, placementInfo) {
241
- let {
242
- placement,
243
- axis,
244
- size
245
- } = placementInfo;
246
-
247
- if (placement === axis) {
248
- return Math.max(0, childOffset[axis] - boundaryDimensions[axis] - boundaryDimensions.scroll[axis] + containerOffsetWithBoundary[axis] - margins[axis] - margins[$c13020473a0fe27b1a1c4797269d1704$var$FLIPPED_DIRECTION[axis]] - padding);
249
- }
250
-
251
- return Math.max(0, boundaryDimensions[size] + boundaryDimensions[axis] + boundaryDimensions.scroll[axis] - containerOffsetWithBoundary[axis] - childOffset[axis] - childOffset[size] - margins[axis] - margins[$c13020473a0fe27b1a1c4797269d1704$var$FLIPPED_DIRECTION[axis]] - padding);
171
+ function $5935ba4d7da2c103$var$getMaxHeight(position, boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding) {
172
+ return position.top != null ? Math.max(0, boundaryDimensions.height + boundaryDimensions.top + boundaryDimensions.scroll.top - (containerOffsetWithBoundary.top + position.top) - (margins.top + margins.bottom + padding) // save additional space for margin and padding
173
+ ) : Math.max(0, childOffset.top + containerOffsetWithBoundary.top - (boundaryDimensions.top + boundaryDimensions.scroll.top) - (margins.top + margins.bottom + padding) // save additional space for margin and padding
174
+ );
252
175
  }
253
-
254
- function $c13020473a0fe27b1a1c4797269d1704$export$calculatePositionInternal(placementInput, childOffset, overlaySize, scrollSize, margins, padding, flip, boundaryDimensions, containerOffsetWithBoundary, offset, crossOffset, isContainerPositioned) {
255
- let placementInfo = $c13020473a0fe27b1a1c4797269d1704$var$parsePlacement(placementInput);
256
- let {
257
- size,
258
- crossAxis,
259
- crossSize,
260
- placement,
261
- crossPlacement
262
- } = placementInfo;
263
- let position = $c13020473a0fe27b1a1c4797269d1704$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned);
264
- let normalizedOffset = offset;
265
- let space = $c13020473a0fe27b1a1c4797269d1704$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding + offset, placementInfo); // Check if the scroll size of the overlay is greater than the available space to determine if we need to flip
266
-
267
- if (flip && scrollSize[size] > space) {
268
- let flippedPlacementInfo = $c13020473a0fe27b1a1c4797269d1704$var$parsePlacement($c13020473a0fe27b1a1c4797269d1704$var$FLIPPED_DIRECTION[placement] + " " + crossPlacement);
269
- let flippedPosition = $c13020473a0fe27b1a1c4797269d1704$var$computePosition(childOffset, boundaryDimensions, overlaySize, flippedPlacementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned);
270
- let flippedSpace = $c13020473a0fe27b1a1c4797269d1704$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding + offset, flippedPlacementInfo); // If the available space for the flipped position is greater than the original available space, flip.
271
-
272
- if (flippedSpace > space) {
273
- placementInfo = flippedPlacementInfo;
274
- position = flippedPosition;
275
- normalizedOffset = offset;
276
- }
277
- }
278
-
279
- let delta = $c13020473a0fe27b1a1c4797269d1704$var$getDelta(crossAxis, position[crossAxis], overlaySize[crossSize], boundaryDimensions, padding);
280
- position[crossAxis] += delta;
281
- let maxHeight = $c13020473a0fe27b1a1c4797269d1704$var$getMaxHeight(position, boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding);
282
- overlaySize.height = Math.min(overlaySize.height, maxHeight);
283
- position = $c13020473a0fe27b1a1c4797269d1704$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, normalizedOffset, crossOffset, containerOffsetWithBoundary, isContainerPositioned);
284
- delta = $c13020473a0fe27b1a1c4797269d1704$var$getDelta(crossAxis, position[crossAxis], overlaySize[crossSize], boundaryDimensions, padding);
285
- position[crossAxis] += delta;
286
- let arrowPosition = {};
287
- arrowPosition[crossAxis] = childOffset[crossAxis] - position[crossAxis] + childOffset[crossSize] / 2;
288
- return {
289
- position,
290
- maxHeight: maxHeight,
291
- arrowOffsetLeft: arrowPosition.left,
292
- arrowOffsetTop: arrowPosition.top,
293
- placement: placementInfo.placement
294
- };
295
- }
296
- /**
297
- * Determines where to place the overlay with regards to the target and the position of an optional indicator.
298
- */
299
-
300
-
301
- function $c13020473a0fe27b1a1c4797269d1704$export$calculatePosition(opts) {
302
- let {
303
- placement,
304
- targetNode,
305
- overlayNode,
306
- scrollNode,
307
- padding,
308
- shouldFlip,
309
- boundaryElement,
310
- offset,
311
- crossOffset
312
- } = opts;
313
- let container = overlayNode.offsetParent || document.body;
314
- let isBodyContainer = container.tagName === 'BODY';
315
- const containerPositionStyle = window.getComputedStyle(container).position;
316
- let isContainerPositioned = !!containerPositionStyle && containerPositionStyle !== 'static';
317
- let childOffset = isBodyContainer ? _domHelpersQueryOffset(targetNode) : _domHelpersQueryPosition(targetNode, container);
318
-
319
- if (!isBodyContainer) {
320
- childOffset.top += parseInt(_domHelpersStyle(targetNode, 'marginTop'), 10) || 0;
321
- childOffset.left += parseInt(_domHelpersStyle(targetNode, 'marginLeft'), 10) || 0;
322
- }
323
-
324
- let overlaySize = _domHelpersQueryOffset(overlayNode);
325
-
326
- let margins = $c13020473a0fe27b1a1c4797269d1704$var$getMargins(overlayNode);
327
- overlaySize.width += margins.left + margins.right;
328
- overlaySize.height += margins.top + margins.bottom;
329
- let scrollSize = $c13020473a0fe27b1a1c4797269d1704$var$getScroll(scrollNode);
330
- let boundaryDimensions = $c13020473a0fe27b1a1c4797269d1704$var$getContainerDimensions(boundaryElement);
331
- let containerOffsetWithBoundary = boundaryElement.tagName === 'BODY' ? _domHelpersQueryOffset(container) : _domHelpersQueryPosition(container, boundaryElement);
332
- return $c13020473a0fe27b1a1c4797269d1704$export$calculatePositionInternal(placement, childOffset, overlaySize, scrollSize, margins, padding, shouldFlip, boundaryDimensions, containerOffsetWithBoundary, offset, crossOffset, isContainerPositioned);
176
+ function $5935ba4d7da2c103$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding, placementInfo) {
177
+ let { placement: placement , axis: axis , size: size } = placementInfo;
178
+ if (placement === axis) return Math.max(0, childOffset[axis] - boundaryDimensions[axis] - boundaryDimensions.scroll[axis] + containerOffsetWithBoundary[axis] - margins[axis] - margins[$5935ba4d7da2c103$var$FLIPPED_DIRECTION[axis]] - padding);
179
+ return Math.max(0, boundaryDimensions[size] + boundaryDimensions[axis] + boundaryDimensions.scroll[axis] - containerOffsetWithBoundary[axis] - childOffset[axis] - childOffset[size] - margins[axis] - margins[$5935ba4d7da2c103$var$FLIPPED_DIRECTION[axis]] - padding);
333
180
  }
334
-
335
- // This behavior moved from useOverlayTrigger to useOverlayPosition.
336
- // For backward compatibility, where useOverlayTrigger handled hiding the popover on close,
337
- // it sets a close function here mapped from the trigger element. This way we can avoid
338
- // forcing users to pass an onClose function to useOverlayPosition which could be considered
339
- // a breaking change.
340
- const $ceea668dd9ec3b754bdc10a8bbb8$export$onCloseMap = new WeakMap();
341
-
342
- /** @private */
343
- function $ceea668dd9ec3b754bdc10a8bbb8$export$useCloseOnScroll(opts) {
344
- let {
345
- triggerRef,
346
- isOpen,
347
- onClose
348
- } = opts;
349
- useEffect(() => {
350
- if (!isOpen) {
351
- return;
181
+ function $5935ba4d7da2c103$export$6839422d1f33cee9(placementInput, childOffset, overlaySize, scrollSize, margins, padding, flip, boundaryDimensions, containerOffsetWithBoundary, offset, crossOffset, isContainerPositioned, userSetMaxHeight) {
182
+ let placementInfo = $5935ba4d7da2c103$var$parsePlacement(placementInput);
183
+ let { size: size , crossAxis: crossAxis , crossSize: crossSize , placement: placement , crossPlacement: crossPlacement } = placementInfo;
184
+ let position = $5935ba4d7da2c103$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned);
185
+ let normalizedOffset = offset;
186
+ let space = $5935ba4d7da2c103$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding + offset, placementInfo);
187
+ // Check if the scroll size of the overlay is greater than the available space to determine if we need to flip
188
+ if (flip && scrollSize[size] > space) {
189
+ let flippedPlacementInfo = $5935ba4d7da2c103$var$parsePlacement(`${$5935ba4d7da2c103$var$FLIPPED_DIRECTION[placement]} ${crossPlacement}`);
190
+ let flippedPosition = $5935ba4d7da2c103$var$computePosition(childOffset, boundaryDimensions, overlaySize, flippedPlacementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned);
191
+ let flippedSpace = $5935ba4d7da2c103$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding + offset, flippedPlacementInfo);
192
+ // If the available space for the flipped position is greater than the original available space, flip.
193
+ if (flippedSpace > space) {
194
+ placementInfo = flippedPlacementInfo;
195
+ position = flippedPosition;
196
+ normalizedOffset = offset;
197
+ }
352
198
  }
353
-
354
- let onScroll = e => {
355
- // Ignore if scrolling an scrollable region outside the trigger's tree.
356
- let target = e.target; // window is not a Node and doesn't have contain, but window contains everything
357
-
358
- if (!triggerRef.current || target instanceof Node && !target.contains(triggerRef.current)) {
359
- return;
360
- }
361
-
362
- let onCloseHandler = onClose || $ceea668dd9ec3b754bdc10a8bbb8$export$onCloseMap.get(triggerRef.current);
363
-
364
- if (onCloseHandler) {
365
- onCloseHandler();
366
- }
199
+ let delta = $5935ba4d7da2c103$var$getDelta(crossAxis, position[crossAxis], overlaySize[crossSize], boundaryDimensions, padding);
200
+ position[crossAxis] += delta;
201
+ let maxHeight = $5935ba4d7da2c103$var$getMaxHeight(position, boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding);
202
+ if (userSetMaxHeight && userSetMaxHeight < maxHeight) maxHeight = userSetMaxHeight;
203
+ overlaySize.height = Math.min(overlaySize.height, maxHeight);
204
+ position = $5935ba4d7da2c103$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, normalizedOffset, crossOffset, containerOffsetWithBoundary, isContainerPositioned);
205
+ delta = $5935ba4d7da2c103$var$getDelta(crossAxis, position[crossAxis], overlaySize[crossSize], boundaryDimensions, padding);
206
+ position[crossAxis] += delta;
207
+ let arrowPosition = {
367
208
  };
368
-
369
- window.addEventListener('scroll', onScroll, true);
370
- return () => {
371
- window.removeEventListener('scroll', onScroll, true);
209
+ arrowPosition[crossAxis] = childOffset[crossAxis] - position[crossAxis] + childOffset[crossSize] / 2;
210
+ return {
211
+ position: position,
212
+ maxHeight: maxHeight,
213
+ arrowOffsetLeft: arrowPosition.left,
214
+ arrowOffsetTop: arrowPosition.top,
215
+ placement: placementInfo.placement
372
216
  };
373
- }, [isOpen, onClose, triggerRef]);
374
217
  }
375
-
376
- // @ts-ignore
377
- let $adfbd034e9bc71c1$var$visualViewport = typeof window !== 'undefined' && window.visualViewport;
378
- /**
379
- * Handles positioning overlays like popovers and menus relative to a trigger
380
- * element, and updating the position when the window resizes.
381
- */
382
-
383
- function useOverlayPosition(props) {
384
- let {
385
- direction
386
- } = useLocale();
387
- let {
388
- targetRef,
389
- overlayRef,
390
- scrollRef = overlayRef,
391
- placement = 'bottom',
392
- containerPadding = 12,
393
- shouldFlip = true,
394
- boundaryElement = typeof document !== 'undefined' ? document.body : null,
395
- offset = 0,
396
- crossOffset = 0,
397
- shouldUpdatePosition = true,
398
- isOpen = true,
399
- onClose
400
- } = props;
401
- let [position, setPosition] = useState({
402
- position: {},
403
- arrowOffsetLeft: undefined,
404
- arrowOffsetTop: undefined,
405
- maxHeight: undefined,
406
- placement: undefined
407
- });
408
- let deps = [shouldUpdatePosition, placement, overlayRef.current, targetRef.current, scrollRef.current, containerPadding, shouldFlip, boundaryElement, offset, crossOffset, isOpen, direction];
409
- let updatePosition = useCallback(() => {
410
- if (shouldUpdatePosition === false || !isOpen || !overlayRef.current || !targetRef.current || !scrollRef.current || !boundaryElement) {
411
- return;
218
+ function $5935ba4d7da2c103$export$b3ceb0cbf1056d98(opts) {
219
+ let { placement: placement , targetNode: targetNode , overlayNode: overlayNode , scrollNode: scrollNode , padding: padding , shouldFlip: shouldFlip , boundaryElement: boundaryElement , offset: offset , crossOffset: crossOffset , maxHeight: maxHeight } = opts;
220
+ let container = overlayNode.offsetParent || document.body;
221
+ let isBodyContainer = container.tagName === 'BODY';
222
+ const containerPositionStyle = window.getComputedStyle(container).position;
223
+ let isContainerPositioned = !!containerPositionStyle && containerPositionStyle !== 'static';
224
+ let childOffset = isBodyContainer ? ($parcel$interopDefault($6Zb2x$domhelpersqueryoffset))(targetNode) : ($parcel$interopDefault($6Zb2x$domhelpersqueryposition))(targetNode, container);
225
+ if (!isBodyContainer) {
226
+ childOffset.top += parseInt(($parcel$interopDefault($6Zb2x$domhelpersstyle))(targetNode, 'marginTop'), 10) || 0;
227
+ childOffset.left += parseInt(($parcel$interopDefault($6Zb2x$domhelpersstyle))(targetNode, 'marginLeft'), 10) || 0;
412
228
  }
229
+ let overlaySize = ($parcel$interopDefault($6Zb2x$domhelpersqueryoffset))(overlayNode);
230
+ let margins = $5935ba4d7da2c103$var$getMargins(overlayNode);
231
+ overlaySize.width += margins.left + margins.right;
232
+ overlaySize.height += margins.top + margins.bottom;
233
+ let scrollSize = $5935ba4d7da2c103$var$getScroll(scrollNode);
234
+ let boundaryDimensions = $5935ba4d7da2c103$var$getContainerDimensions(boundaryElement);
235
+ let containerOffsetWithBoundary = boundaryElement.tagName === 'BODY' ? ($parcel$interopDefault($6Zb2x$domhelpersqueryoffset))(container) : ($parcel$interopDefault($6Zb2x$domhelpersqueryposition))(container, boundaryElement);
236
+ return $5935ba4d7da2c103$export$6839422d1f33cee9(placement, childOffset, overlaySize, scrollSize, margins, padding, shouldFlip, boundaryDimensions, containerOffsetWithBoundary, offset, crossOffset, isContainerPositioned, maxHeight);
237
+ }
413
238
 
414
- setPosition($c13020473a0fe27b1a1c4797269d1704$export$calculatePosition({
415
- placement: $adfbd034e9bc71c1$var$translateRTL(placement, direction),
416
- overlayNode: overlayRef.current,
417
- targetNode: targetRef.current,
418
- scrollNode: scrollRef.current,
419
- padding: containerPadding,
420
- shouldFlip,
421
- boundaryElement,
422
- offset,
423
- crossOffset
424
- }));
425
- }, deps); // Update position when anything changes
426
-
427
- useLayoutEffect(updatePosition, deps); // Update position on window resize
428
239
 
429
- $adfbd034e9bc71c1$var$useResize(updatePosition); // Reposition the overlay and do not close on scroll while the visual viewport is resizing.
430
- // This will ensure that overlays adjust their positioning when the iOS virtual keyboard appears.
431
240
 
432
- let isResizing = useRef(false);
433
- useLayoutEffect(() => {
434
- let timeout;
435
241
 
436
- let onResize = () => {
437
- isResizing.current = true;
438
- clearTimeout(timeout);
439
- timeout = setTimeout(() => {
440
- isResizing.current = false;
441
- }, 500);
442
- updatePosition();
443
- };
242
+ const $9a8aa1b0b336ea3a$export$f6211563215e3b37 = new WeakMap();
243
+ function $9a8aa1b0b336ea3a$export$18fc8428861184da(opts) {
244
+ let { triggerRef: triggerRef , isOpen: isOpen , onClose: onClose } = opts;
245
+ $6Zb2x$react.useEffect(()=>{
246
+ if (!isOpen) return;
247
+ let onScroll = (e)=>{
248
+ // Ignore if scrolling an scrollable region outside the trigger's tree.
249
+ let target = e.target;
250
+ // window is not a Node and doesn't have contain, but window contains everything
251
+ if (!triggerRef.current || target instanceof Node && !target.contains(triggerRef.current)) return;
252
+ let onCloseHandler = onClose || $9a8aa1b0b336ea3a$export$f6211563215e3b37.get(triggerRef.current);
253
+ if (onCloseHandler) onCloseHandler();
254
+ };
255
+ window.addEventListener('scroll', onScroll, true);
256
+ return ()=>{
257
+ window.removeEventListener('scroll', onScroll, true);
258
+ };
259
+ }, [
260
+ isOpen,
261
+ onClose,
262
+ triggerRef
263
+ ]);
264
+ }
444
265
 
445
- $adfbd034e9bc71c1$var$visualViewport == null ? void 0 : $adfbd034e9bc71c1$var$visualViewport.addEventListener('resize', onResize);
446
- return () => {
447
- $adfbd034e9bc71c1$var$visualViewport == null ? void 0 : $adfbd034e9bc71c1$var$visualViewport.removeEventListener('resize', onResize);
448
- };
449
- }, [updatePosition]);
450
- let close = useCallback(() => {
451
- if (!isResizing.current) {
452
- onClose();
453
- }
454
- }, [onClose, isResizing]); // When scrolling a parent scrollable region of the trigger (other than the body),
455
- // we hide the popover. Otherwise, its position would be incorrect.
456
266
 
457
- $ceea668dd9ec3b754bdc10a8bbb8$export$useCloseOnScroll({
458
- triggerRef: targetRef,
459
- isOpen,
460
- onClose: onClose ? close : undefined
461
- });
462
- return {
463
- overlayProps: {
464
- style: _babelRuntimeHelpersExtends({
465
- position: 'absolute',
466
- zIndex: 100000
467
- }, position.position, {
468
- maxHeight: position.maxHeight
469
- })
470
- },
471
- placement: position.placement,
472
- arrowProps: {
473
- style: {
474
- left: position.arrowOffsetLeft,
475
- top: position.arrowOffsetTop
476
- }
477
- },
478
- updatePosition
479
- };
480
- }
481
267
 
482
- exports.useOverlayPosition = useOverlayPosition;
483
268
 
484
- function $adfbd034e9bc71c1$var$useResize(onResize) {
485
- useLayoutEffect(() => {
486
- window.addEventListener('resize', onResize, false);
487
- return () => {
488
- window.removeEventListener('resize', onResize, false);
269
+ // @ts-ignore
270
+ let $cd94b4896dd97759$var$visualViewport = typeof window !== 'undefined' && window.visualViewport;
271
+ function $cd94b4896dd97759$export$d39e1813b3bdd0e1(props) {
272
+ let { direction: direction } = $6Zb2x$reactariai18n.useLocale();
273
+ let { targetRef: targetRef , overlayRef: overlayRef , scrollRef: scrollRef = overlayRef , placement: placement = 'bottom' , containerPadding: containerPadding = 12 , shouldFlip: shouldFlip = true , boundaryElement: boundaryElement = typeof document !== 'undefined' ? document.body : null , offset: offset = 0 , crossOffset: crossOffset = 0 , shouldUpdatePosition: shouldUpdatePosition = true , isOpen: isOpen = true , onClose: onClose , maxHeight: maxHeight } = props;
274
+ let [position, setPosition] = $6Zb2x$react.useState({
275
+ position: {
276
+ },
277
+ arrowOffsetLeft: undefined,
278
+ arrowOffsetTop: undefined,
279
+ maxHeight: undefined,
280
+ placement: undefined
281
+ });
282
+ let deps = [
283
+ shouldUpdatePosition,
284
+ placement,
285
+ overlayRef.current,
286
+ targetRef.current,
287
+ scrollRef.current,
288
+ containerPadding,
289
+ shouldFlip,
290
+ boundaryElement,
291
+ offset,
292
+ crossOffset,
293
+ isOpen,
294
+ direction,
295
+ maxHeight
296
+ ];
297
+ let updatePosition = $6Zb2x$react.useCallback(()=>{
298
+ if (shouldUpdatePosition === false || !isOpen || !overlayRef.current || !targetRef.current || !scrollRef.current || !boundaryElement) return;
299
+ setPosition($5935ba4d7da2c103$export$b3ceb0cbf1056d98({
300
+ placement: $cd94b4896dd97759$var$translateRTL(placement, direction),
301
+ overlayNode: overlayRef.current,
302
+ targetNode: targetRef.current,
303
+ scrollNode: scrollRef.current,
304
+ padding: containerPadding,
305
+ shouldFlip: shouldFlip,
306
+ boundaryElement: boundaryElement,
307
+ offset: offset,
308
+ crossOffset: crossOffset,
309
+ maxHeight: maxHeight
310
+ }));
311
+ }, deps);
312
+ // Update position when anything changes
313
+ $6Zb2x$reactariautils.useLayoutEffect(updatePosition, deps);
314
+ // Update position on window resize
315
+ $cd94b4896dd97759$var$useResize(updatePosition);
316
+ // Reposition the overlay and do not close on scroll while the visual viewport is resizing.
317
+ // This will ensure that overlays adjust their positioning when the iOS virtual keyboard appears.
318
+ let isResizing = $6Zb2x$react.useRef(false);
319
+ $6Zb2x$reactariautils.useLayoutEffect(()=>{
320
+ let timeout;
321
+ let onResize = ()=>{
322
+ isResizing.current = true;
323
+ clearTimeout(timeout);
324
+ timeout = setTimeout(()=>{
325
+ isResizing.current = false;
326
+ }, 500);
327
+ updatePosition();
328
+ };
329
+ $cd94b4896dd97759$var$visualViewport === null || $cd94b4896dd97759$var$visualViewport === void 0 ? void 0 : $cd94b4896dd97759$var$visualViewport.addEventListener('resize', onResize);
330
+ return ()=>{
331
+ $cd94b4896dd97759$var$visualViewport === null || $cd94b4896dd97759$var$visualViewport === void 0 ? void 0 : $cd94b4896dd97759$var$visualViewport.removeEventListener('resize', onResize);
332
+ };
333
+ }, [
334
+ updatePosition
335
+ ]);
336
+ let close = $6Zb2x$react.useCallback(()=>{
337
+ if (!isResizing.current) onClose();
338
+ }, [
339
+ onClose,
340
+ isResizing
341
+ ]);
342
+ // When scrolling a parent scrollable region of the trigger (other than the body),
343
+ // we hide the popover. Otherwise, its position would be incorrect.
344
+ $9a8aa1b0b336ea3a$export$18fc8428861184da({
345
+ triggerRef: targetRef,
346
+ isOpen: isOpen,
347
+ onClose: onClose ? close : undefined
348
+ });
349
+ return {
350
+ overlayProps: {
351
+ style: {
352
+ position: 'absolute',
353
+ zIndex: 100000,
354
+ ...position.position,
355
+ maxHeight: position.maxHeight
356
+ }
357
+ },
358
+ placement: position.placement,
359
+ arrowProps: {
360
+ style: {
361
+ left: position.arrowOffsetLeft,
362
+ top: position.arrowOffsetTop
363
+ }
364
+ },
365
+ updatePosition: updatePosition
489
366
  };
490
- }, [onResize]);
491
367
  }
492
-
493
- function $adfbd034e9bc71c1$var$translateRTL(position, direction) {
494
- if (direction === 'rtl') {
495
- return position.replace('start', 'right').replace('end', 'left');
496
- }
497
-
498
- return position.replace('start', 'left').replace('end', 'right');
368
+ function $cd94b4896dd97759$var$useResize(onResize) {
369
+ $6Zb2x$reactariautils.useLayoutEffect(()=>{
370
+ window.addEventListener('resize', onResize, false);
371
+ return ()=>{
372
+ window.removeEventListener('resize', onResize, false);
373
+ };
374
+ }, [
375
+ onResize
376
+ ]);
377
+ }
378
+ function $cd94b4896dd97759$var$translateRTL(position, direction) {
379
+ if (direction === 'rtl') return position.replace('start', 'right').replace('end', 'left');
380
+ return position.replace('start', 'left').replace('end', 'right');
499
381
  }
500
382
 
501
- const $a59c58b6dadb0208d379e9464d2377f7$var$visibleOverlays = [];
502
- /**
503
- * Provides the behavior for overlays such as dialogs, popovers, and menus.
504
- * Hides the overlay when the user interacts outside it, when the Escape key is pressed,
505
- * or optionally, on blur. Only the top-most overlay will close at once.
506
- */
507
-
508
- function useOverlay(props, ref) {
509
- let {
510
- onClose,
511
- shouldCloseOnBlur,
512
- isOpen,
513
- isDismissable = false,
514
- isKeyboardDismissDisabled = false,
515
- shouldCloseOnInteractOutside
516
- } = props; // Add the overlay ref to the stack of visible overlays on mount, and remove on unmount.
517
-
518
- useEffect(() => {
519
- if (isOpen) {
520
- $a59c58b6dadb0208d379e9464d2377f7$var$visibleOverlays.push(ref);
521
- }
522
-
523
- return () => {
524
- let index = $a59c58b6dadb0208d379e9464d2377f7$var$visibleOverlays.indexOf(ref);
525
383
 
526
- if (index >= 0) {
527
- $a59c58b6dadb0208d379e9464d2377f7$var$visibleOverlays.splice(index, 1);
528
- }
384
+ var $82711f9cb668ecdb$exports = {};
385
+
386
+ $parcel$export($82711f9cb668ecdb$exports, "useOverlay", () => $82711f9cb668ecdb$export$ea8f71083e90600f);
387
+
388
+
389
+ const $82711f9cb668ecdb$var$visibleOverlays = [];
390
+ function $82711f9cb668ecdb$export$ea8f71083e90600f(props, ref) {
391
+ let { onClose: onClose , shouldCloseOnBlur: shouldCloseOnBlur , isOpen: isOpen , isDismissable: isDismissable = false , isKeyboardDismissDisabled: isKeyboardDismissDisabled = false , shouldCloseOnInteractOutside: shouldCloseOnInteractOutside } = props;
392
+ // Add the overlay ref to the stack of visible overlays on mount, and remove on unmount.
393
+ $6Zb2x$react.useEffect(()=>{
394
+ if (isOpen) $82711f9cb668ecdb$var$visibleOverlays.push(ref);
395
+ return ()=>{
396
+ let index = $82711f9cb668ecdb$var$visibleOverlays.indexOf(ref);
397
+ if (index >= 0) $82711f9cb668ecdb$var$visibleOverlays.splice(index, 1);
398
+ };
399
+ }, [
400
+ isOpen,
401
+ ref
402
+ ]);
403
+ // Only hide the overlay when it is the topmost visible overlay in the stack.
404
+ let onHide = ()=>{
405
+ if ($82711f9cb668ecdb$var$visibleOverlays[$82711f9cb668ecdb$var$visibleOverlays.length - 1] === ref && onClose) onClose();
406
+ };
407
+ let onInteractOutsideStart = (e)=>{
408
+ if (!shouldCloseOnInteractOutside || shouldCloseOnInteractOutside(e.target)) {
409
+ if ($82711f9cb668ecdb$var$visibleOverlays[$82711f9cb668ecdb$var$visibleOverlays.length - 1] === ref) {
410
+ e.stopPropagation();
411
+ e.preventDefault();
412
+ }
413
+ }
414
+ };
415
+ let onInteractOutside = (e)=>{
416
+ if (!shouldCloseOnInteractOutside || shouldCloseOnInteractOutside(e.target)) {
417
+ if ($82711f9cb668ecdb$var$visibleOverlays[$82711f9cb668ecdb$var$visibleOverlays.length - 1] === ref) {
418
+ e.stopPropagation();
419
+ e.preventDefault();
420
+ }
421
+ onHide();
422
+ }
423
+ };
424
+ // Handle the escape key
425
+ let onKeyDown = (e)=>{
426
+ if (e.key === 'Escape' && !isKeyboardDismissDisabled) {
427
+ e.preventDefault();
428
+ onHide();
429
+ }
430
+ };
431
+ // Handle clicking outside the overlay to close it
432
+ $6Zb2x$reactariainteractions.useInteractOutside({
433
+ ref: ref,
434
+ onInteractOutside: isDismissable ? onInteractOutside : null,
435
+ onInteractOutsideStart: onInteractOutsideStart
436
+ });
437
+ let { focusWithinProps: focusWithinProps } = $6Zb2x$reactariainteractions.useFocusWithin({
438
+ isDisabled: !shouldCloseOnBlur,
439
+ onBlurWithin: (e)=>{
440
+ if (!shouldCloseOnInteractOutside || shouldCloseOnInteractOutside(e.relatedTarget)) onClose();
441
+ }
442
+ });
443
+ let onPointerDownUnderlay = (e)=>{
444
+ // fixes a firefox issue that starts text selection https://bugzilla.mozilla.org/show_bug.cgi?id=1675846
445
+ if (e.target === e.currentTarget) e.preventDefault();
446
+ };
447
+ return {
448
+ overlayProps: {
449
+ onKeyDown: onKeyDown,
450
+ ...focusWithinProps
451
+ },
452
+ underlayProps: {
453
+ onPointerDown: onPointerDownUnderlay
454
+ }
529
455
  };
530
- }, [isOpen, ref]); // Only hide the overlay when it is the topmost visible overlay in the stack.
531
-
532
- let onHide = () => {
533
- if ($a59c58b6dadb0208d379e9464d2377f7$var$visibleOverlays[$a59c58b6dadb0208d379e9464d2377f7$var$visibleOverlays.length - 1] === ref && onClose) {
534
- onClose();
535
- }
536
- };
537
-
538
- let onInteractOutsideStart = e => {
539
- if (!shouldCloseOnInteractOutside || shouldCloseOnInteractOutside(e.target)) {
540
- if ($a59c58b6dadb0208d379e9464d2377f7$var$visibleOverlays[$a59c58b6dadb0208d379e9464d2377f7$var$visibleOverlays.length - 1] === ref) {
541
- e.stopPropagation();
542
- e.preventDefault();
543
- }
544
- }
545
- };
546
-
547
- let onInteractOutside = e => {
548
- if (!shouldCloseOnInteractOutside || shouldCloseOnInteractOutside(e.target)) {
549
- if ($a59c58b6dadb0208d379e9464d2377f7$var$visibleOverlays[$a59c58b6dadb0208d379e9464d2377f7$var$visibleOverlays.length - 1] === ref) {
550
- e.stopPropagation();
551
- e.preventDefault();
552
- }
553
-
554
- onHide();
555
- }
556
- }; // Handle the escape key
557
-
558
-
559
- let onKeyDown = e => {
560
- if (e.key === 'Escape' && !isKeyboardDismissDisabled) {
561
- e.preventDefault();
562
- onHide();
563
- }
564
- }; // Handle clicking outside the overlay to close it
565
-
566
-
567
- useInteractOutside({
568
- ref,
569
- onInteractOutside: isDismissable ? onInteractOutside : null,
570
- onInteractOutsideStart
571
- });
572
- let {
573
- focusWithinProps
574
- } = useFocusWithin({
575
- isDisabled: !shouldCloseOnBlur,
576
- onBlurWithin: e => {
577
- if (!shouldCloseOnInteractOutside || shouldCloseOnInteractOutside(e.relatedTarget)) {
578
- onClose();
579
- }
580
- }
581
- });
582
-
583
- let onPointerDownUnderlay = e => {
584
- // fixes a firefox issue that starts text selection https://bugzilla.mozilla.org/show_bug.cgi?id=1675846
585
- if (e.target === e.currentTarget) {
586
- e.preventDefault();
587
- }
588
- };
589
-
590
- return {
591
- overlayProps: _babelRuntimeHelpersExtends({
592
- onKeyDown
593
- }, focusWithinProps),
594
- underlayProps: {
595
- onPointerDown: onPointerDownUnderlay
596
- }
597
- };
598
456
  }
599
457
 
600
- exports.useOverlay = useOverlay;
601
458
 
602
- /**
603
- * Handles the behavior and accessibility for an overlay trigger, e.g. a button
604
- * that opens a popover, menu, or other overlay that is positioned relative to the trigger.
605
- */
606
- function useOverlayTrigger(props, state, ref) {
607
- let {
608
- type
609
- } = props;
610
- let {
611
- isOpen
612
- } = state; // Backward compatibility. Share state close function with useOverlayPosition so it can close on scroll
613
- // without forcing users to pass onClose.
614
-
615
- useEffect(() => {
616
- if (ref && ref.current) {
617
- $ceea668dd9ec3b754bdc10a8bbb8$export$onCloseMap.set(ref.current, state.close);
618
- }
619
- }); // Aria 1.1 supports multiple values for aria-haspopup other than just menus.
620
- // https://www.w3.org/TR/wai-aria-1.1/#aria-haspopup
621
- // However, we only add it for menus for now because screen readers often
622
- // announce it as a menu even for other values.
623
-
624
- let ariaHasPopup = undefined;
625
-
626
- if (type === 'menu') {
627
- ariaHasPopup = true;
628
- } else if (type === 'listbox') {
629
- ariaHasPopup = 'listbox';
630
- }
631
-
632
- let overlayId = useId();
633
- return {
634
- triggerProps: {
635
- 'aria-haspopup': ariaHasPopup,
636
- 'aria-expanded': isOpen,
637
- 'aria-controls': isOpen ? overlayId : null
638
- },
639
- overlayProps: {
640
- id: overlayId
641
- }
642
- };
459
+ var $b4878eb6316f670a$exports = {};
460
+
461
+ $parcel$export($b4878eb6316f670a$exports, "useOverlayTrigger", () => $b4878eb6316f670a$export$f9d5c8beee7d008d);
462
+
463
+
464
+
465
+ function $b4878eb6316f670a$export$f9d5c8beee7d008d(props, state, ref) {
466
+ let { type: type } = props;
467
+ let { isOpen: isOpen } = state;
468
+ // Backward compatibility. Share state close function with useOverlayPosition so it can close on scroll
469
+ // without forcing users to pass onClose.
470
+ $6Zb2x$react.useEffect(()=>{
471
+ if (ref && ref.current) $9a8aa1b0b336ea3a$export$f6211563215e3b37.set(ref.current, state.close);
472
+ });
473
+ // Aria 1.1 supports multiple values for aria-haspopup other than just menus.
474
+ // https://www.w3.org/TR/wai-aria-1.1/#aria-haspopup
475
+ // However, we only add it for menus for now because screen readers often
476
+ // announce it as a menu even for other values.
477
+ let ariaHasPopup = undefined;
478
+ if (type === 'menu') ariaHasPopup = true;
479
+ else if (type === 'listbox') ariaHasPopup = 'listbox';
480
+ let overlayId = $6Zb2x$reactariautils.useId();
481
+ return {
482
+ triggerProps: {
483
+ 'aria-haspopup': ariaHasPopup,
484
+ 'aria-expanded': isOpen,
485
+ 'aria-controls': isOpen ? overlayId : null
486
+ },
487
+ overlayProps: {
488
+ id: overlayId
489
+ }
490
+ };
643
491
  }
644
492
 
645
- exports.useOverlayTrigger = useOverlayTrigger;
646
- // @ts-ignore
647
- const $a21edfc55f5392c9a20c9978f0e487$var$visualViewport = typeof window !== 'undefined' && window.visualViewport; // HTML input types that do not cause the software keyboard to appear.
648
493
 
649
- const $a21edfc55f5392c9a20c9978f0e487$var$nonTextInputTypes = new Set(['checkbox', 'radio', 'range', 'color', 'file', 'image', 'button', 'submit', 'reset']);
650
- /**
651
- * Prevents scrolling on the document body on mount, and
652
- * restores it on unmount. Also ensures that content does not
653
- * shift due to the scrollbars disappearing.
654
- */
655
-
656
- function usePreventScroll(options) {
657
- if (options === void 0) {
658
- options = {};
659
- }
660
-
661
- let {
662
- isDisabled
663
- } = options;
664
- useLayoutEffect(() => {
665
- if (isDisabled) {
666
- return;
667
- }
494
+ var $5c2f5cd01815d369$exports = {};
668
495
 
669
- if (isIOS()) {
670
- return $a21edfc55f5392c9a20c9978f0e487$var$preventScrollMobileSafari();
671
- } else {
672
- return $a21edfc55f5392c9a20c9978f0e487$var$preventScrollStandard();
673
- }
674
- }, [isDisabled]);
675
- } // For most browsers, all we need to do is set `overflow: hidden` on the root element, and
676
- // add some padding to prevent the page from shifting when the scrollbar is hidden.
496
+ $parcel$export($5c2f5cd01815d369$exports, "usePreventScroll", () => $5c2f5cd01815d369$export$ee0f7cc6afcd1c18);
677
497
 
678
-
679
- exports.usePreventScroll = usePreventScroll;
680
-
681
- function $a21edfc55f5392c9a20c9978f0e487$var$preventScrollStandard() {
682
- return chain($a21edfc55f5392c9a20c9978f0e487$var$setStyle(document.documentElement, 'paddingRight', window.innerWidth - document.documentElement.clientWidth + "px"), $a21edfc55f5392c9a20c9978f0e487$var$setStyle(document.documentElement, 'overflow', 'hidden'));
683
- } // Mobile Safari is a whole different beast. Even with overflow: hidden,
498
+ // @ts-ignore
499
+ const $5c2f5cd01815d369$var$visualViewport = typeof window !== 'undefined' && window.visualViewport;
500
+ // HTML input types that do not cause the software keyboard to appear.
501
+ const $5c2f5cd01815d369$var$nonTextInputTypes = new Set([
502
+ 'checkbox',
503
+ 'radio',
504
+ 'range',
505
+ 'color',
506
+ 'file',
507
+ 'image',
508
+ 'button',
509
+ 'submit',
510
+ 'reset'
511
+ ]);
512
+ function $5c2f5cd01815d369$export$ee0f7cc6afcd1c18(options = {
513
+ }) {
514
+ let { isDisabled: isDisabled } = options;
515
+ $6Zb2x$reactariautils.useLayoutEffect(()=>{
516
+ if (isDisabled) return;
517
+ if ($6Zb2x$reactariautils.isIOS()) return $5c2f5cd01815d369$var$preventScrollMobileSafari();
518
+ else return $5c2f5cd01815d369$var$preventScrollStandard();
519
+ }, [
520
+ isDisabled
521
+ ]);
522
+ }
523
+ // For most browsers, all we need to do is set `overflow: hidden` on the root element, and
524
+ // add some padding to prevent the page from shifting when the scrollbar is hidden.
525
+ function $5c2f5cd01815d369$var$preventScrollStandard() {
526
+ return $6Zb2x$reactariautils.chain($5c2f5cd01815d369$var$setStyle(document.documentElement, 'paddingRight', `${window.innerWidth - document.documentElement.clientWidth}px`), $5c2f5cd01815d369$var$setStyle(document.documentElement, 'overflow', 'hidden'));
527
+ }
528
+ // Mobile Safari is a whole different beast. Even with overflow: hidden,
684
529
  // it still scrolls the page in many situations:
685
530
  //
686
531
  // 1. When the bottom toolbar and address bar are collapsed, page scrolling is always allowed.
@@ -706,592 +551,507 @@ function $a21edfc55f5392c9a20c9978f0e487$var$preventScrollStandard() {
706
551
  // above work or Safari will still try to scroll the page when focusing an input.
707
552
  // 6. As a last resort, handle window scroll events, and scroll back to the top. This can happen when attempting
708
553
  // to navigate to an input with the next/previous buttons that's outside a modal.
554
+ function $5c2f5cd01815d369$var$preventScrollMobileSafari() {
555
+ let scrollable;
556
+ let lastY = 0;
557
+ let onTouchStart = (e)=>{
558
+ // Store the nearest scrollable parent element from the element that the user touched.
559
+ scrollable = $6Zb2x$reactariautils.getScrollParent(e.target);
560
+ if (scrollable === document.documentElement && scrollable === document.body) return;
561
+ lastY = e.changedTouches[0].pageY;
562
+ };
563
+ let onTouchMove = (e)=>{
564
+ // Prevent scrolling the window.
565
+ if (scrollable === document.documentElement || scrollable === document.body) {
566
+ e.preventDefault();
567
+ return;
568
+ }
569
+ // Prevent scrolling up when at the top and scrolling down when at the bottom
570
+ // of a nested scrollable area, otherwise mobile Safari will start scrolling
571
+ // the window instead. Unfortunately, this disables bounce scrolling when at
572
+ // the top but it's the best we can do.
573
+ let y = e.changedTouches[0].pageY;
574
+ let scrollTop = scrollable.scrollTop;
575
+ let bottom = scrollable.scrollHeight - scrollable.clientHeight;
576
+ if (scrollTop <= 0 && y > lastY || scrollTop >= bottom && y < lastY) e.preventDefault();
577
+ lastY = y;
578
+ };
579
+ let onTouchEnd = (e)=>{
580
+ let target = e.target;
581
+ if (target instanceof HTMLInputElement && !$5c2f5cd01815d369$var$nonTextInputTypes.has(target.type)) {
582
+ e.preventDefault();
583
+ // Apply a transform to trick Safari into thinking the input is at the top of the page
584
+ // so it doesn't try to scroll it into view. When tapping on an input, this needs to
585
+ // be done before the "focus" event, so we have to focus the element ourselves.
586
+ target.style.transform = 'translateY(-2000px)';
587
+ target.focus();
588
+ requestAnimationFrame(()=>{
589
+ target.style.transform = '';
590
+ });
591
+ }
592
+ };
593
+ let onFocus = (e)=>{
594
+ let target = e.target;
595
+ if (target instanceof HTMLInputElement && !$5c2f5cd01815d369$var$nonTextInputTypes.has(target.type)) {
596
+ // Transform also needs to be applied in the focus event in cases where focus moves
597
+ // other than tapping on an input directly, e.g. the next/previous buttons in the
598
+ // software keyboard. In these cases, it seems applying the transform in the focus event
599
+ // is good enough, whereas when tapping an input, it must be done before the focus event. 🤷‍♂️
600
+ target.style.transform = 'translateY(-2000px)';
601
+ requestAnimationFrame(()=>{
602
+ target.style.transform = '';
603
+ // This will have prevented the browser from scrolling the focused element into view,
604
+ // so we need to do this ourselves in a way that doesn't cause the whole page to scroll.
605
+ if ($5c2f5cd01815d369$var$visualViewport) {
606
+ if ($5c2f5cd01815d369$var$visualViewport.height < window.innerHeight) // If the keyboard is already visible, do this after one additional frame
607
+ // to wait for the transform to be removed.
608
+ requestAnimationFrame(()=>{
609
+ $5c2f5cd01815d369$var$scrollIntoView(target);
610
+ });
611
+ else // Otherwise, wait for the visual viewport to resize before scrolling so we can
612
+ // measure the correct position to scroll to.
613
+ $5c2f5cd01815d369$var$visualViewport.addEventListener('resize', ()=>$5c2f5cd01815d369$var$scrollIntoView(target)
614
+ , {
615
+ once: true
616
+ });
617
+ }
618
+ });
619
+ }
620
+ };
621
+ let onWindowScroll = ()=>{
622
+ // Last resort. If the window scrolled, scroll it back to the top.
623
+ // It should always be at the top because the body will have a negative margin (see below).
624
+ window.scrollTo(0, 0);
625
+ };
626
+ // Record the original scroll position so we can restore it.
627
+ // Then apply a negative margin to the body to offset it by the scroll position. This will
628
+ // enable us to scroll the window to the top, which is required for the rest of this to work.
629
+ let scrollX = window.pageXOffset;
630
+ let scrollY = window.pageYOffset;
631
+ let restoreStyles = $6Zb2x$reactariautils.chain($5c2f5cd01815d369$var$setStyle(document.documentElement, 'paddingRight', `${window.innerWidth - document.documentElement.clientWidth}px`), $5c2f5cd01815d369$var$setStyle(document.documentElement, 'overflow', 'hidden'), $5c2f5cd01815d369$var$setStyle(document.body, 'marginTop', `-${scrollY}px`));
632
+ // Scroll to the top. The negative margin on the body will make this appear the same.
633
+ window.scrollTo(0, 0);
634
+ let removeEvents = $6Zb2x$reactariautils.chain($5c2f5cd01815d369$var$addEvent(document, 'touchstart', onTouchStart, {
635
+ passive: false,
636
+ capture: true
637
+ }), $5c2f5cd01815d369$var$addEvent(document, 'touchmove', onTouchMove, {
638
+ passive: false,
639
+ capture: true
640
+ }), $5c2f5cd01815d369$var$addEvent(document, 'touchend', onTouchEnd, {
641
+ passive: false,
642
+ capture: true
643
+ }), $5c2f5cd01815d369$var$addEvent(document, 'focus', onFocus, true), $5c2f5cd01815d369$var$addEvent(window, 'scroll', onWindowScroll));
644
+ return ()=>{
645
+ // Restore styles and scroll the page back to where it was.
646
+ restoreStyles();
647
+ removeEvents();
648
+ window.scrollTo(scrollX, scrollY);
649
+ };
650
+ }
651
+ // Sets a CSS property on an element, and returns a function to revert it to the previous value.
652
+ function $5c2f5cd01815d369$var$setStyle(element, style, value) {
653
+ let cur = element.style[style];
654
+ element.style[style] = value;
655
+ return ()=>{
656
+ element.style[style] = cur;
657
+ };
658
+ }
659
+ // Adds an event listener to an element, and returns a function to remove it.
660
+ function $5c2f5cd01815d369$var$addEvent(target, event, handler, options) {
661
+ target.addEventListener(event, handler, options);
662
+ return ()=>{
663
+ target.removeEventListener(event, handler, options);
664
+ };
665
+ }
666
+ function $5c2f5cd01815d369$var$scrollIntoView(target) {
667
+ // Find the parent scrollable element and adjust the scroll position if the target is not already in view.
668
+ let scrollable = $6Zb2x$reactariautils.getScrollParent(target);
669
+ if (scrollable !== document.documentElement && scrollable !== document.body) {
670
+ let scrollableTop = scrollable.getBoundingClientRect().top;
671
+ let targetTop = target.getBoundingClientRect().top;
672
+ if (targetTop > scrollableTop + target.clientHeight) scrollable.scrollTop += targetTop - scrollableTop;
673
+ }
674
+ }
709
675
 
710
676
 
711
- function $a21edfc55f5392c9a20c9978f0e487$var$preventScrollMobileSafari() {
712
- let scrollable;
713
- let lastY = 0;
677
+ var $0775ea8ea6a0565e$exports = {};
678
+
679
+ $parcel$export($0775ea8ea6a0565e$exports, "ModalProvider", () => $0775ea8ea6a0565e$export$178405afcd8c5eb);
680
+ $parcel$export($0775ea8ea6a0565e$exports, "useModalProvider", () => $0775ea8ea6a0565e$export$d9aaed4c3ece1bc0);
681
+ $parcel$export($0775ea8ea6a0565e$exports, "OverlayProvider", () => $0775ea8ea6a0565e$export$bf688221f59024e5);
682
+ $parcel$export($0775ea8ea6a0565e$exports, "OverlayContainer", () => $0775ea8ea6a0565e$export$b47c3594eab58386);
683
+ $parcel$export($0775ea8ea6a0565e$exports, "useModal", () => $0775ea8ea6a0565e$export$33ffd74ebf07f060);
684
+
685
+
686
+ const $0775ea8ea6a0565e$var$Context = /*#__PURE__*/ ($parcel$interopDefault($6Zb2x$react)).createContext(null);
687
+ function $0775ea8ea6a0565e$export$178405afcd8c5eb(props) {
688
+ let { children: children } = props;
689
+ let parent = $6Zb2x$react.useContext($0775ea8ea6a0565e$var$Context);
690
+ let [modalCount, setModalCount] = $6Zb2x$react.useState(0);
691
+ let context = $6Zb2x$react.useMemo(()=>({
692
+ parent: parent,
693
+ modalCount: modalCount,
694
+ addModal () {
695
+ setModalCount((count)=>count + 1
696
+ );
697
+ if (parent) parent.addModal();
698
+ },
699
+ removeModal () {
700
+ setModalCount((count)=>count - 1
701
+ );
702
+ if (parent) parent.removeModal();
703
+ }
704
+ })
705
+ , [
706
+ parent,
707
+ modalCount
708
+ ]);
709
+ return(/*#__PURE__*/ ($parcel$interopDefault($6Zb2x$react)).createElement($0775ea8ea6a0565e$var$Context.Provider, {
710
+ value: context
711
+ }, children));
712
+ }
713
+ function $0775ea8ea6a0565e$export$d9aaed4c3ece1bc0() {
714
+ let context = $6Zb2x$react.useContext($0775ea8ea6a0565e$var$Context);
715
+ return {
716
+ modalProviderProps: {
717
+ 'aria-hidden': context && context.modalCount > 0 ? true : null
718
+ }
719
+ };
720
+ }
721
+ /**
722
+ * Creates a root node that will be aria-hidden if there are other modals open.
723
+ */ function $0775ea8ea6a0565e$var$OverlayContainerDOM(props) {
724
+ let { modalProviderProps: modalProviderProps } = $0775ea8ea6a0565e$export$d9aaed4c3ece1bc0();
725
+ return(/*#__PURE__*/ ($parcel$interopDefault($6Zb2x$react)).createElement("div", {
726
+ "data-overlay-container": true,
727
+ ...props,
728
+ ...modalProviderProps
729
+ }));
730
+ }
731
+ function $0775ea8ea6a0565e$export$bf688221f59024e5(props) {
732
+ return(/*#__PURE__*/ ($parcel$interopDefault($6Zb2x$react)).createElement($0775ea8ea6a0565e$export$178405afcd8c5eb, null, /*#__PURE__*/ ($parcel$interopDefault($6Zb2x$react)).createElement($0775ea8ea6a0565e$var$OverlayContainerDOM, props)));
733
+ }
734
+ function $0775ea8ea6a0565e$export$b47c3594eab58386(props) {
735
+ let { portalContainer: portalContainer = document.body , ...rest } = props;
736
+ ($parcel$interopDefault($6Zb2x$react)).useEffect(()=>{
737
+ if (portalContainer.closest('[data-overlay-container]')) throw new Error('An OverlayContainer must not be inside another container. Please change the portalContainer prop.');
738
+ }, [
739
+ portalContainer
740
+ ]);
741
+ let contents = /*#__PURE__*/ ($parcel$interopDefault($6Zb2x$react)).createElement($0775ea8ea6a0565e$export$bf688221f59024e5, rest);
742
+ return(/*#__PURE__*/ ($parcel$interopDefault($6Zb2x$reactdom)).createPortal(contents, portalContainer));
743
+ }
744
+ function $0775ea8ea6a0565e$export$33ffd74ebf07f060(options) {
745
+ // Add aria-hidden to all parent providers on mount, and restore on unmount.
746
+ let context = $6Zb2x$react.useContext($0775ea8ea6a0565e$var$Context);
747
+ if (!context) throw new Error('Modal is not contained within a provider');
748
+ $6Zb2x$react.useEffect(()=>{
749
+ if ((options === null || options === void 0 ? void 0 : options.isDisabled) || !context || !context.parent) return;
750
+ // The immediate context is from the provider containing this modal, so we only
751
+ // want to trigger aria-hidden on its parents not on the modal provider itself.
752
+ context.parent.addModal();
753
+ return ()=>{
754
+ if (context && context.parent) context.parent.removeModal();
755
+ };
756
+ }, [
757
+ context,
758
+ context.parent,
759
+ options === null || options === void 0 ? void 0 : options.isDisabled
760
+ ]);
761
+ return {
762
+ modalProps: {
763
+ 'data-ismodal': !(options === null || options === void 0 ? void 0 : options.isDisabled)
764
+ }
765
+ };
766
+ }
714
767
 
715
- let onTouchStart = e => {
716
- // Store the nearest scrollable parent element from the element that the user touched.
717
- scrollable = getScrollParent(e.target);
718
768
 
719
- if (scrollable === document.documentElement && scrollable === document.body) {
720
- return;
721
- }
769
+ var $f69bb3e6457495cc$exports = {};
722
770
 
723
- lastY = e.changedTouches[0].pageY;
724
- };
771
+ $parcel$export($f69bb3e6457495cc$exports, "DismissButton", () => $f69bb3e6457495cc$export$2317d149ed6f78c4);
772
+ var $18d014414048a7ba$exports = {};
773
+ var $4393d9b86d3ad278$exports = {};
774
+ $4393d9b86d3ad278$exports = JSON.parse("{\"dismiss\":\"تجاهل\"}");
725
775
 
726
- let onTouchMove = e => {
727
- // Prevent scrolling the window.
728
- if (scrollable === document.documentElement || scrollable === document.body) {
729
- e.preventDefault();
730
- return;
731
- } // Prevent scrolling up when at the top and scrolling down when at the bottom
732
- // of a nested scrollable area, otherwise mobile Safari will start scrolling
733
- // the window instead. Unfortunately, this disables bounce scrolling when at
734
- // the top but it's the best we can do.
735
776
 
777
+ var $254224013ae06959$exports = {};
778
+ $254224013ae06959$exports = JSON.parse("{\"dismiss\":\"Отхвърляне\"}");
736
779
 
737
- let y = e.changedTouches[0].pageY;
738
- let scrollTop = scrollable.scrollTop;
739
- let bottom = scrollable.scrollHeight - scrollable.clientHeight;
740
780
 
741
- if (scrollTop <= 0 && y > lastY || scrollTop >= bottom && y < lastY) {
742
- e.preventDefault();
743
- }
781
+ var $55d3567b59d09782$exports = {};
782
+ $55d3567b59d09782$exports = JSON.parse("{\"dismiss\":\"Odstranit\"}");
744
783
 
745
- lastY = y;
746
- };
747
784
 
748
- let onTouchEnd = e => {
749
- let target = e.target;
785
+ var $0e419a7be7773c16$exports = {};
786
+ $0e419a7be7773c16$exports = JSON.parse("{\"dismiss\":\"Luk\"}");
750
787
 
751
- if (target instanceof HTMLInputElement && !$a21edfc55f5392c9a20c9978f0e487$var$nonTextInputTypes.has(target.type)) {
752
- e.preventDefault(); // Apply a transform to trick Safari into thinking the input is at the top of the page
753
- // so it doesn't try to scroll it into view. When tapping on an input, this needs to
754
- // be done before the "focus" event, so we have to focus the element ourselves.
755
788
 
756
- target.style.transform = 'translateY(-2000px)';
757
- target.focus();
758
- requestAnimationFrame(() => {
759
- target.style.transform = '';
760
- });
761
- }
762
- };
763
-
764
- let onFocus = e => {
765
- let target = e.target;
766
-
767
- if (target instanceof HTMLInputElement && !$a21edfc55f5392c9a20c9978f0e487$var$nonTextInputTypes.has(target.type)) {
768
- // Transform also needs to be applied in the focus event in cases where focus moves
769
- // software keyboard. In these cases, it seems applying the transform in the focus event
770
- // is good enough, whereas when tapping an input, it must be done before the focus event. 🤷‍♂️
771
- target.style.transform = 'translateY(-2000px)';
772
- requestAnimationFrame(() => {
773
- target.style.transform = ''; // This will have prevented the browser from scrolling the focused element into view,
774
- // so we need to do this ourselves in a way that doesn't cause the whole page to scroll.
775
-
776
- if ($a21edfc55f5392c9a20c9978f0e487$var$visualViewport) {
777
- if ($a21edfc55f5392c9a20c9978f0e487$var$visualViewport.height < window.innerHeight) {
778
- // If the keyboard is already visible, do this after one additional frame
779
- // to wait for the transform to be removed.
780
- requestAnimationFrame(() => {
781
- $a21edfc55f5392c9a20c9978f0e487$var$scrollIntoView(target);
782
- });
783
- } else {
784
- // Otherwise, wait for the visual viewport to resize before scrolling so we can
785
- // measure the correct position to scroll to.
786
- $a21edfc55f5392c9a20c9978f0e487$var$visualViewport.addEventListener('resize', () => $a21edfc55f5392c9a20c9978f0e487$var$scrollIntoView(target), {
787
- once: true
788
- });
789
- }
790
- }
791
- });
792
- }
793
- };
789
+ var $be606513c8356c34$exports = {};
790
+ $be606513c8356c34$exports = JSON.parse("{\"dismiss\":\"Schließen\"}");
794
791
 
795
- let onWindowScroll = () => {
796
- // Last resort. If the window scrolled, scroll it back to the top.
797
- // It should always be at the top because the body will have a negative margin (see below).
798
- window.scrollTo(0, 0);
799
- }; // Record the original scroll position so we can restore it.
800
- // Then apply a negative margin to the body to offset it by the scroll position. This will
801
- // enable us to scroll the window to the top, which is required for the rest of this to work.
802
-
803
-
804
- let scrollX = window.pageXOffset;
805
- let scrollY = window.pageYOffset;
806
- let restoreStyles = chain($a21edfc55f5392c9a20c9978f0e487$var$setStyle(document.documentElement, 'paddingRight', window.innerWidth - document.documentElement.clientWidth + "px"), $a21edfc55f5392c9a20c9978f0e487$var$setStyle(document.documentElement, 'overflow', 'hidden'), $a21edfc55f5392c9a20c9978f0e487$var$setStyle(document.body, 'marginTop', "-" + scrollY + "px")); // Scroll to the top. The negative margin on the body will make this appear the same.
807
-
808
- window.scrollTo(0, 0);
809
- let removeEvents = chain($a21edfc55f5392c9a20c9978f0e487$var$addEvent(document, 'touchstart', onTouchStart, {
810
- passive: false,
811
- capture: true
812
- }), $a21edfc55f5392c9a20c9978f0e487$var$addEvent(document, 'touchmove', onTouchMove, {
813
- passive: false,
814
- capture: true
815
- }), $a21edfc55f5392c9a20c9978f0e487$var$addEvent(document, 'touchend', onTouchEnd, {
816
- passive: false,
817
- capture: true
818
- }), $a21edfc55f5392c9a20c9978f0e487$var$addEvent(document, 'focus', onFocus, true), $a21edfc55f5392c9a20c9978f0e487$var$addEvent(window, 'scroll', onWindowScroll));
819
- return () => {
820
- // Restore styles and scroll the page back to where it was.
821
- restoreStyles();
822
- removeEvents();
823
- window.scrollTo(scrollX, scrollY);
824
- };
825
- } // Sets a CSS property on an element, and returns a function to revert it to the previous value.
826
-
827
-
828
- function $a21edfc55f5392c9a20c9978f0e487$var$setStyle(element, style, value) {
829
- let cur = element.style[style];
830
- element.style[style] = value;
831
- return () => {
832
- element.style[style] = cur;
833
- };
834
- } // Adds an event listener to an element, and returns a function to remove it.
835
-
836
-
837
- function $a21edfc55f5392c9a20c9978f0e487$var$addEvent(target, event, handler, options) {
838
- target.addEventListener(event, handler, options);
839
- return () => {
840
- target.removeEventListener(event, handler, options);
841
- };
842
- }
843
792
 
844
- function $a21edfc55f5392c9a20c9978f0e487$var$scrollIntoView(target) {
845
- // Find the parent scrollable element and adjust the scroll position if the target is not already in view.
846
- let scrollable = getScrollParent(target);
793
+ var $7d99787e5bd26f87$exports = {};
794
+ $7d99787e5bd26f87$exports = JSON.parse("{\"dismiss\":\"Απόρριψη\"}");
847
795
 
848
- if (scrollable !== document.documentElement && scrollable !== document.body) {
849
- let scrollableTop = scrollable.getBoundingClientRect().top;
850
- let targetTop = target.getBoundingClientRect().top;
851
796
 
852
- if (targetTop > scrollableTop + target.clientHeight) {
853
- scrollable.scrollTop += targetTop - scrollableTop;
854
- }
855
- }
856
- }
797
+ var $0360f2a6534752c1$exports = {};
798
+ $0360f2a6534752c1$exports = JSON.parse("{\"dismiss\":\"Dismiss\"}");
857
799
 
858
- const $c5f9596976ab8bd94c5879001549a3e$var$Context = /*#__PURE__*/_react.createContext(null);
859
- /**
860
- * Each ModalProvider tracks how many modals are open in its subtree. On mount, the modals
861
- * trigger `addModal` to increment the count, and trigger `removeModal` on unmount to decrement it.
862
- * This is done recursively so that all parent providers are incremented and decremented.
863
- * If the modal count is greater than zero, we add `aria-hidden` to this provider to hide its
864
- * subtree from screen readers. This is done using React context in order to account for things
865
- * like portals, which can cause the React tree and the DOM tree to differ significantly in structure.
866
- */
867
-
868
-
869
- function ModalProvider(props) {
870
- let {
871
- children
872
- } = props;
873
- let parent = useContext($c5f9596976ab8bd94c5879001549a3e$var$Context);
874
- let [modalCount, setModalCount] = useState(0);
875
- let context = useMemo(() => ({
876
- parent,
877
- modalCount,
878
-
879
- addModal() {
880
- setModalCount(count => count + 1);
881
-
882
- if (parent) {
883
- parent.addModal();
884
- }
885
- },
886
800
 
887
- removeModal() {
888
- setModalCount(count => count - 1);
801
+ var $92bf4fdecfeb6a61$exports = {};
802
+ $92bf4fdecfeb6a61$exports = JSON.parse("{\"dismiss\":\"Descartar\"}");
889
803
 
890
- if (parent) {
891
- parent.removeModal();
892
- }
893
- }
894
804
 
895
- }), [parent, modalCount]);
896
- return /*#__PURE__*/_react.createElement($c5f9596976ab8bd94c5879001549a3e$var$Context.Provider, {
897
- value: context
898
- }, children);
899
- }
805
+ var $7c02fa9b9c598043$exports = {};
806
+ $7c02fa9b9c598043$exports = JSON.parse("{\"dismiss\":\"Lõpeta\"}");
900
807
 
901
- exports.ModalProvider = ModalProvider;
902
808
 
903
- /**
904
- * Used to determine if the tree should be aria-hidden based on how many
905
- * modals are open.
906
- */
907
- function useModalProvider() {
908
- let context = useContext($c5f9596976ab8bd94c5879001549a3e$var$Context);
909
- return {
910
- modalProviderProps: {
911
- 'aria-hidden': context && context.modalCount > 0 ? true : null
912
- }
913
- };
914
- }
915
- /**
916
- * Creates a root node that will be aria-hidden if there are other modals open.
917
- */
809
+ var $ba53535dcca59343$exports = {};
810
+ $ba53535dcca59343$exports = JSON.parse("{\"dismiss\":\"Hylkää\"}");
918
811
 
919
812
 
920
- exports.useModalProvider = useModalProvider;
813
+ var $2fbbcddf7d252cb7$exports = {};
814
+ $2fbbcddf7d252cb7$exports = JSON.parse("{\"dismiss\":\"Rejeter\"}");
921
815
 
922
- function $c5f9596976ab8bd94c5879001549a3e$var$OverlayContainerDOM(props) {
923
- let {
924
- modalProviderProps
925
- } = useModalProvider();
926
- return /*#__PURE__*/_react.createElement("div", _babelRuntimeHelpersExtends({
927
- "data-overlay-container": true
928
- }, props, modalProviderProps));
929
- }
930
- /**
931
- * An OverlayProvider acts as a container for the top-level application.
932
- * Any application that uses modal dialogs or other overlays should
933
- * be wrapped in a `<OverlayProvider>`. This is used to ensure that
934
- * the main content of the application is hidden from screen readers
935
- * if a modal or other overlay is opened. Only the top-most modal or
936
- * overlay should be accessible at once.
937
- */
938
816
 
817
+ var $0a1f0520e07d3596$exports = {};
818
+ $0a1f0520e07d3596$exports = JSON.parse("{\"dismiss\":\"התעלם\"}");
939
819
 
940
- function OverlayProvider(props) {
941
- return /*#__PURE__*/_react.createElement(ModalProvider, null, /*#__PURE__*/_react.createElement($c5f9596976ab8bd94c5879001549a3e$var$OverlayContainerDOM, props));
942
- }
943
820
 
944
- exports.OverlayProvider = OverlayProvider;
821
+ var $f7be5df1487823a9$exports = {};
822
+ $f7be5df1487823a9$exports = JSON.parse("{\"dismiss\":\"Odbaci\"}");
945
823
 
946
- /**
947
- * A container for overlays like modals and popovers. Renders the overlay
948
- * into a Portal which is placed at the end of the document body.
949
- * Also ensures that the overlay is hidden from screen readers if a
950
- * nested modal is opened. Only the top-most modal or overlay should
951
- * be accessible at once.
952
- */
953
- function OverlayContainer(props) {
954
- let {
955
- portalContainer = document.body
956
- } = props,
957
- rest = _babelRuntimeHelpersObjectWithoutPropertiesLoose(props, ["portalContainer"]);
958
-
959
- _react.useEffect(() => {
960
- if (portalContainer.closest('[data-overlay-container]')) {
961
- throw new Error('An OverlayContainer must not be inside another container. Please change the portalContainer prop.');
962
- }
963
- }, [portalContainer]);
964
824
 
965
- let contents = /*#__PURE__*/_react.createElement(OverlayProvider, rest);
825
+ var $8dbe4363bfbba3f9$exports = {};
826
+ $8dbe4363bfbba3f9$exports = JSON.parse("{\"dismiss\":\"Elutasítás\"}");
966
827
 
967
- return /*#__PURE__*/_reactDom.createPortal(contents, portalContainer);
968
- }
969
828
 
970
- exports.OverlayContainer = OverlayContainer;
829
+ var $90a445da1ad273e7$exports = {};
830
+ $90a445da1ad273e7$exports = JSON.parse("{\"dismiss\":\"Ignora\"}");
971
831
 
972
- /**
973
- * Hides content outside the current `<OverlayContainer>` from screen readers
974
- * on mount and restores it on unmount. Typically used by modal dialogs and
975
- * other types of overlays to ensure that only the top-most modal is
976
- * accessible at once.
977
- */
978
- function useModal(options) {
979
- // Add aria-hidden to all parent providers on mount, and restore on unmount.
980
- let context = useContext($c5f9596976ab8bd94c5879001549a3e$var$Context);
981
-
982
- if (!context) {
983
- throw new Error('Modal is not contained within a provider');
984
- }
985
-
986
- useEffect(() => {
987
- if (options != null && options.isDisabled || !context || !context.parent) {
988
- return;
989
- } // The immediate context is from the provider containing this modal, so we only
990
- // want to trigger aria-hidden on its parents not on the modal provider itself.
991
832
 
833
+ var $e1ebf18259c9b1ee$exports = {};
834
+ $e1ebf18259c9b1ee$exports = JSON.parse("{\"dismiss\":\"閉じる\"}");
992
835
 
993
- context.parent.addModal();
994
- return () => {
995
- if (context && context.parent) {
996
- context.parent.removeModal();
997
- }
998
- };
999
- }, [context, context.parent, options == null ? void 0 : options.isDisabled]);
1000
- return {
1001
- modalProps: {
1002
- 'data-ismodal': !(options != null && options.isDisabled)
1003
- }
1004
- };
1005
- }
1006
836
 
1007
- exports.useModal = useModal;
1008
- // ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-aria/overlays/intl/ar-AE.json
1009
- var $a8bb21dadcfaad10bb0a0bcf2b281764$exports = {};
1010
- $a8bb21dadcfaad10bb0a0bcf2b281764$exports = JSON.parse("{\"dismiss\":\"تجاهل\"}");
1011
- // ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-aria/overlays/intl/bg-BG.json
1012
- var $dafefe57ee4fa5270277199b63666456$exports = {};
1013
- $dafefe57ee4fa5270277199b63666456$exports = JSON.parse("{\"dismiss\":\"Отхвърляне\"}");
1014
- // ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-aria/overlays/intl/cs-CZ.json
1015
- var $c2158ac3aac63d05c0787f91c5e6$exports = {};
1016
- $c2158ac3aac63d05c0787f91c5e6$exports = JSON.parse("{\"dismiss\":\"Odstranit\"}");
1017
- // ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-aria/overlays/intl/da-DK.json
1018
- var $f7aea96abdaae1eb301c63fe67ff9fa$exports = {};
1019
- $f7aea96abdaae1eb301c63fe67ff9fa$exports = JSON.parse("{\"dismiss\":\"Luk\"}");
1020
- // ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-aria/overlays/intl/de-DE.json
1021
- var $f3491c664171e6b5e47db3baca390e$exports = {};
1022
- $f3491c664171e6b5e47db3baca390e$exports = JSON.parse("{\"dismiss\":\"Schließen\"}");
1023
- // ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-aria/overlays/intl/el-GR.json
1024
- var $da631def8a53d3d7ca63b5a989a2$exports = {};
1025
- $da631def8a53d3d7ca63b5a989a2$exports = JSON.parse("{\"dismiss\":\"Απόρριψη\"}");
1026
- // ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-aria/overlays/intl/en-US.json
1027
- var $fb4c477a38a74b935d35db24ae7$exports = {};
1028
- $fb4c477a38a74b935d35db24ae7$exports = JSON.parse("{\"dismiss\":\"Dismiss\"}");
1029
- // ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-aria/overlays/intl/es-ES.json
1030
- var $b6fd69f9d5c0d1736b0ffb60159dbd4$exports = {};
1031
- $b6fd69f9d5c0d1736b0ffb60159dbd4$exports = JSON.parse("{\"dismiss\":\"Descartar\"}");
1032
- // ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-aria/overlays/intl/et-EE.json
1033
- var $ba5713ed42715892c62c91f4a61185db$exports = {};
1034
- $ba5713ed42715892c62c91f4a61185db$exports = JSON.parse("{\"dismiss\":\"Lõpeta\"}");
1035
- // ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-aria/overlays/intl/fi-FI.json
1036
- var $d425c7f620a7cd6fec958b2d805b4748$exports = {};
1037
- $d425c7f620a7cd6fec958b2d805b4748$exports = JSON.parse("{\"dismiss\":\"Hylkää\"}");
1038
- // ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-aria/overlays/intl/fr-FR.json
1039
- var $a53b9b9e4ee3c32689ca1c9d37$exports = {};
1040
- $a53b9b9e4ee3c32689ca1c9d37$exports = JSON.parse("{\"dismiss\":\"Rejeter\"}");
1041
- // ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-aria/overlays/intl/he-IL.json
1042
- var $c53806192c6b46eb32dc82efae908cb$exports = {};
1043
- $c53806192c6b46eb32dc82efae908cb$exports = JSON.parse("{\"dismiss\":\"התעלם\"}");
1044
- // ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-aria/overlays/intl/hr-HR.json
1045
- var $cbbca9d8ba35e50d9d74ddc492ac95d5$exports = {};
1046
- $cbbca9d8ba35e50d9d74ddc492ac95d5$exports = JSON.parse("{\"dismiss\":\"Odbaci\"}");
1047
- // ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-aria/overlays/intl/hu-HU.json
1048
- var $b6e1f06770a0ad8a02049cb304d$exports = {};
1049
- $b6e1f06770a0ad8a02049cb304d$exports = JSON.parse("{\"dismiss\":\"Elutasítás\"}");
1050
- // ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-aria/overlays/intl/it-IT.json
1051
- var $b6c1d31d04e4e80df25d89ebefb38d6c$exports = {};
1052
- $b6c1d31d04e4e80df25d89ebefb38d6c$exports = JSON.parse("{\"dismiss\":\"Ignora\"}");
1053
- // ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-aria/overlays/intl/ja-JP.json
1054
- var $a858c6dc87cf51add44cd600186b$exports = {};
1055
- $a858c6dc87cf51add44cd600186b$exports = JSON.parse("{\"dismiss\":\"閉じる\"}");
1056
- // ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-aria/overlays/intl/ko-KR.json
1057
- var $bce3a6596f5d6bce7af4e1cdfe714b9$exports = {};
1058
- $bce3a6596f5d6bce7af4e1cdfe714b9$exports = JSON.parse("{\"dismiss\":\"무시\"}");
1059
- // ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-aria/overlays/intl/lt-LT.json
1060
- var $a80424d4da258b90efdca51671420e98$exports = {};
1061
- $a80424d4da258b90efdca51671420e98$exports = JSON.parse("{\"dismiss\":\"Atmesti\"}");
1062
- // ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-aria/overlays/intl/lv-LV.json
1063
- var $b7b9bc8c0cfc6eec9fa971e7b25cd656$exports = {};
1064
- $b7b9bc8c0cfc6eec9fa971e7b25cd656$exports = JSON.parse("{\"dismiss\":\"Nerādīt\"}");
1065
- // ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-aria/overlays/intl/nb-NO.json
1066
- var $e985758bae9fabb24500c21a0a00b725$exports = {};
1067
- $e985758bae9fabb24500c21a0a00b725$exports = JSON.parse("{\"dismiss\":\"Lukk\"}");
1068
- // ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-aria/overlays/intl/nl-NL.json
1069
- var $f05d419963f6daeda3bc9dbbe3cc02bd$exports = {};
1070
- $f05d419963f6daeda3bc9dbbe3cc02bd$exports = JSON.parse("{\"dismiss\":\"Negeren\"}");
1071
- // ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-aria/overlays/intl/pl-PL.json
1072
- var $c8fa3e85daf6d04ed07583e629c87ce4$exports = {};
1073
- $c8fa3e85daf6d04ed07583e629c87ce4$exports = JSON.parse("{\"dismiss\":\"Zignoruj\"}");
1074
- // ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-aria/overlays/intl/pt-BR.json
1075
- var $f06e8ad24001ed35ea808810226a15$exports = {};
1076
- $f06e8ad24001ed35ea808810226a15$exports = JSON.parse("{\"dismiss\":\"Descartar\"}");
1077
- // ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-aria/overlays/intl/pt-PT.json
1078
- var $fd097ce7a9000ad9750e5946ad880932$exports = {};
1079
- $fd097ce7a9000ad9750e5946ad880932$exports = JSON.parse("{\"dismiss\":\"Dispensar\"}");
1080
- // ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-aria/overlays/intl/ro-RO.json
1081
- var $a20ad400f1086b2bea7f9791d7257ad$exports = {};
1082
- $a20ad400f1086b2bea7f9791d7257ad$exports = JSON.parse("{\"dismiss\":\"Revocare\"}");
1083
- // ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-aria/overlays/intl/ru-RU.json
1084
- var $fc28441a9133071c2297a09b6b420dd$exports = {};
1085
- $fc28441a9133071c2297a09b6b420dd$exports = JSON.parse("{\"dismiss\":\"Пропустить\"}");
1086
- // ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-aria/overlays/intl/sk-SK.json
1087
- var $a91ecad4479ad50b50aa177a2506dc$exports = {};
1088
- $a91ecad4479ad50b50aa177a2506dc$exports = JSON.parse("{\"dismiss\":\"Zrušiť\"}");
1089
- // ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-aria/overlays/intl/sl-SI.json
1090
- var $f9693ead50748c9beb107ad23956eb9$exports = {};
1091
- $f9693ead50748c9beb107ad23956eb9$exports = JSON.parse("{\"dismiss\":\"Opusti\"}");
1092
- // ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-aria/overlays/intl/sr-SP.json
1093
- var $b5e22101ce830f7d95581df69464b$exports = {};
1094
- $b5e22101ce830f7d95581df69464b$exports = JSON.parse("{\"dismiss\":\"Odbaci\"}");
1095
- // ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-aria/overlays/intl/sv-SE.json
1096
- var $c0b006e739315f2d0109fd704d505d4d$exports = {};
1097
- $c0b006e739315f2d0109fd704d505d4d$exports = JSON.parse("{\"dismiss\":\"Avvisa\"}");
1098
- // ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-aria/overlays/intl/tr-TR.json
1099
- var $b2fcb8208d40a3677791cb274f5c23$exports = {};
1100
- $b2fcb8208d40a3677791cb274f5c23$exports = JSON.parse("{\"dismiss\":\"Kapat\"}");
1101
- // ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-aria/overlays/intl/uk-UA.json
1102
- var $bedf08a338a4a9658a5b3265b7ba64$exports = {};
1103
- $bedf08a338a4a9658a5b3265b7ba64$exports = JSON.parse("{\"dismiss\":\"Скасувати\"}");
1104
- // ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-aria/overlays/intl/zh-CN.json
1105
- var $b49f1939211bfd9e1f4f626061efad44$exports = {};
1106
- $b49f1939211bfd9e1f4f626061efad44$exports = JSON.parse("{\"dismiss\":\"取消\"}");
1107
- // ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-aria/overlays/intl/zh-TW.json
1108
- var $a878720d2a5fd83cfd5a0f74b64957e$exports = {};
1109
- $a878720d2a5fd83cfd5a0f74b64957e$exports = JSON.parse("{\"dismiss\":\"關閉\"}");
837
+ var $765893642f3b4f72$exports = {};
838
+ $765893642f3b4f72$exports = JSON.parse("{\"dismiss\":\"무시\"}");
1110
839
 
1111
- /*
1112
- * Copyright 2020 Adobe. All rights reserved.
1113
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
1114
- * you may not use this file except in compliance with the License. You may obtain a copy
1115
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
1116
- *
1117
- * Unless required by applicable law or agreed to in writing, software distributed under
1118
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
1119
- * OF ANY KIND, either express or implied. See the License for the specific language
1120
- * governing permissions and limitations under the License.
1121
- */
1122
- // @ts-ignore
1123
- const $e0a65de2c0deb9a27bf483be129a43c1$var$intlMessages = {
1124
- "ar-AE": _babelRuntimeHelpersInteropRequireDefault($a8bb21dadcfaad10bb0a0bcf2b281764$exports).default,
1125
- "bg-BG": _babelRuntimeHelpersInteropRequireDefault($dafefe57ee4fa5270277199b63666456$exports).default,
1126
- "cs-CZ": _babelRuntimeHelpersInteropRequireDefault($c2158ac3aac63d05c0787f91c5e6$exports).default,
1127
- "da-DK": _babelRuntimeHelpersInteropRequireDefault($f7aea96abdaae1eb301c63fe67ff9fa$exports).default,
1128
- "de-DE": _babelRuntimeHelpersInteropRequireDefault($f3491c664171e6b5e47db3baca390e$exports).default,
1129
- "el-GR": _babelRuntimeHelpersInteropRequireDefault($da631def8a53d3d7ca63b5a989a2$exports).default,
1130
- "en-US": _babelRuntimeHelpersInteropRequireDefault($fb4c477a38a74b935d35db24ae7$exports).default,
1131
- "es-ES": _babelRuntimeHelpersInteropRequireDefault($b6fd69f9d5c0d1736b0ffb60159dbd4$exports).default,
1132
- "et-EE": _babelRuntimeHelpersInteropRequireDefault($ba5713ed42715892c62c91f4a61185db$exports).default,
1133
- "fi-FI": _babelRuntimeHelpersInteropRequireDefault($d425c7f620a7cd6fec958b2d805b4748$exports).default,
1134
- "fr-FR": _babelRuntimeHelpersInteropRequireDefault($a53b9b9e4ee3c32689ca1c9d37$exports).default,
1135
- "he-IL": _babelRuntimeHelpersInteropRequireDefault($c53806192c6b46eb32dc82efae908cb$exports).default,
1136
- "hr-HR": _babelRuntimeHelpersInteropRequireDefault($cbbca9d8ba35e50d9d74ddc492ac95d5$exports).default,
1137
- "hu-HU": _babelRuntimeHelpersInteropRequireDefault($b6e1f06770a0ad8a02049cb304d$exports).default,
1138
- "it-IT": _babelRuntimeHelpersInteropRequireDefault($b6c1d31d04e4e80df25d89ebefb38d6c$exports).default,
1139
- "ja-JP": _babelRuntimeHelpersInteropRequireDefault($a858c6dc87cf51add44cd600186b$exports).default,
1140
- "ko-KR": _babelRuntimeHelpersInteropRequireDefault($bce3a6596f5d6bce7af4e1cdfe714b9$exports).default,
1141
- "lt-LT": _babelRuntimeHelpersInteropRequireDefault($a80424d4da258b90efdca51671420e98$exports).default,
1142
- "lv-LV": _babelRuntimeHelpersInteropRequireDefault($b7b9bc8c0cfc6eec9fa971e7b25cd656$exports).default,
1143
- "nb-NO": _babelRuntimeHelpersInteropRequireDefault($e985758bae9fabb24500c21a0a00b725$exports).default,
1144
- "nl-NL": _babelRuntimeHelpersInteropRequireDefault($f05d419963f6daeda3bc9dbbe3cc02bd$exports).default,
1145
- "pl-PL": _babelRuntimeHelpersInteropRequireDefault($c8fa3e85daf6d04ed07583e629c87ce4$exports).default,
1146
- "pt-BR": _babelRuntimeHelpersInteropRequireDefault($f06e8ad24001ed35ea808810226a15$exports).default,
1147
- "pt-PT": _babelRuntimeHelpersInteropRequireDefault($fd097ce7a9000ad9750e5946ad880932$exports).default,
1148
- "ro-RO": _babelRuntimeHelpersInteropRequireDefault($a20ad400f1086b2bea7f9791d7257ad$exports).default,
1149
- "ru-RU": _babelRuntimeHelpersInteropRequireDefault($fc28441a9133071c2297a09b6b420dd$exports).default,
1150
- "sk-SK": _babelRuntimeHelpersInteropRequireDefault($a91ecad4479ad50b50aa177a2506dc$exports).default,
1151
- "sl-SI": _babelRuntimeHelpersInteropRequireDefault($f9693ead50748c9beb107ad23956eb9$exports).default,
1152
- "sr-SP": _babelRuntimeHelpersInteropRequireDefault($b5e22101ce830f7d95581df69464b$exports).default,
1153
- "sv-SE": _babelRuntimeHelpersInteropRequireDefault($c0b006e739315f2d0109fd704d505d4d$exports).default,
1154
- "tr-TR": _babelRuntimeHelpersInteropRequireDefault($b2fcb8208d40a3677791cb274f5c23$exports).default,
1155
- "uk-UA": _babelRuntimeHelpersInteropRequireDefault($bedf08a338a4a9658a5b3265b7ba64$exports).default,
1156
- "zh-CN": _babelRuntimeHelpersInteropRequireDefault($b49f1939211bfd9e1f4f626061efad44$exports).default,
1157
- "zh-TW": _babelRuntimeHelpersInteropRequireDefault($a878720d2a5fd83cfd5a0f74b64957e$exports).default
1158
- };
1159
840
 
1160
- /**
1161
- * A visually hidden button that can be used to allow screen reader
1162
- * users to dismiss a modal or popup when there is no visual
1163
- * affordance to do so.
1164
- */
1165
- function DismissButton(props) {
1166
- let {
1167
- onDismiss
1168
- } = props;
1169
- let formatMessage = useMessageFormatter($e0a65de2c0deb9a27bf483be129a43c1$var$intlMessages);
1170
-
1171
- let onClick = () => {
1172
- if (onDismiss) {
1173
- onDismiss();
1174
- }
1175
- };
841
+ var $af73ba24f63febd1$exports = {};
842
+ $af73ba24f63febd1$exports = JSON.parse("{\"dismiss\":\"Atmesti\"}");
1176
843
 
1177
- return /*#__PURE__*/_react.createElement(VisuallyHidden, null, /*#__PURE__*/_react.createElement("button", {
1178
- tabIndex: -1,
1179
- "aria-label": formatMessage('dismiss'),
1180
- onClick: onClick
1181
- }));
1182
- }
1183
844
 
1184
- exports.DismissButton = DismissButton;
1185
- // subtracted from when showing it again. When it reaches zero, aria-hidden is removed.
1186
- let $a683bb0d63d5b6f7885c12dcc6f96807$var$refCountMap = new WeakMap();
1187
- /**
1188
- * Hides all elements in the DOM outside the given targets from screen readers using aria-hidden,
1189
- * and returns a function to revert these changes. In addition, changes to the DOM are watched
1190
- * and new elements outside the targets are automatically hidden.
1191
- * @param targets - The elements that should remain visible.
1192
- * @param root - Nothing will be hidden above this element.
1193
- * @returns - A function to restore all hidden elements.
1194
- */
1195
-
1196
- function ariaHideOutside(targets, root) {
1197
- if (root === void 0) {
1198
- root = document.body;
1199
- }
1200
-
1201
- let visibleNodes = new Set(targets);
1202
- let hiddenNodes = new Set();
1203
- let walker = document.createTreeWalker(root, NodeFilter.SHOW_ELEMENT, {
1204
- acceptNode(node) {
1205
- // If this node is a live announcer, add it to the set of nodes to keep visible.
1206
- if (node instanceof HTMLElement && node.dataset.liveAnnouncer === 'true') {
1207
- visibleNodes.add(node);
1208
- } // Skip this node and its children if it is one of the target nodes, or a live announcer.
1209
- // Also skip children of already hidden nodes, as aria-hidden is recursive.
1210
-
1211
-
1212
- if (visibleNodes.has(node) || hiddenNodes.has(node.parentElement)) {
1213
- return NodeFilter.FILTER_REJECT;
1214
- } // VoiceOver on iOS has issues hiding elements with role="row". Hide the cells inside instead.
1215
- // https://bugs.webkit.org/show_bug.cgi?id=222623
1216
-
1217
-
1218
- if (node instanceof HTMLElement && node.getAttribute('role') === 'row') {
1219
- return NodeFilter.FILTER_SKIP;
1220
- } // Skip this node but continue to children if one of the targets is inside the node.
1221
-
1222
-
1223
- if (targets.some(target => node.contains(target))) {
1224
- return NodeFilter.FILTER_SKIP;
1225
- }
845
+ var $97aac9f6740ee412$exports = {};
846
+ $97aac9f6740ee412$exports = JSON.parse("{\"dismiss\":\"Nerādīt\"}");
1226
847
 
1227
- return NodeFilter.FILTER_ACCEPT;
1228
- }
1229
848
 
1230
- });
849
+ var $92fbe76e196d7e0a$exports = {};
850
+ $92fbe76e196d7e0a$exports = JSON.parse("{\"dismiss\":\"Lukk\"}");
1231
851
 
1232
- let hide = node => {
1233
- var _refCountMap$get;
1234
852
 
1235
- let refCount = (_refCountMap$get = $a683bb0d63d5b6f7885c12dcc6f96807$var$refCountMap.get(node)) != null ? _refCountMap$get : 0; // If already aria-hidden, and the ref count is zero, then this element
1236
- // was already hidden and there's nothing for us to do.
853
+ var $44399897afb701ce$exports = {};
854
+ $44399897afb701ce$exports = JSON.parse("{\"dismiss\":\"Negeren\"}");
1237
855
 
1238
- if (node.getAttribute('aria-hidden') === 'true' && refCount === 0) {
1239
- return;
1240
- }
1241
856
 
1242
- if (refCount === 0) {
1243
- node.setAttribute('aria-hidden', 'true');
1244
- }
857
+ var $d679e258664d7384$exports = {};
858
+ $d679e258664d7384$exports = JSON.parse("{\"dismiss\":\"Zignoruj\"}");
1245
859
 
1246
- hiddenNodes.add(node);
1247
- $a683bb0d63d5b6f7885c12dcc6f96807$var$refCountMap.set(node, refCount + 1);
1248
- };
1249
860
 
1250
- let node = walker.nextNode();
861
+ var $b51fc2992648966b$exports = {};
862
+ $b51fc2992648966b$exports = JSON.parse("{\"dismiss\":\"Descartar\"}");
1251
863
 
1252
- while (node != null) {
1253
- hide(node);
1254
- node = walker.nextNode();
1255
- }
1256
864
 
1257
- let observer = new MutationObserver(changes => {
1258
- for (let change of changes) {
1259
- if (change.type !== 'childList' || change.addedNodes.length === 0) {
1260
- continue;
1261
- } // If the parent element of the added nodes is not within one of the targets,
1262
- // and not already inside a hidden node, hide all of the new children.
865
+ var $6abbc540dcd5f78c$exports = {};
866
+ $6abbc540dcd5f78c$exports = JSON.parse("{\"dismiss\":\"Dispensar\"}");
1263
867
 
1264
868
 
1265
- if (![...visibleNodes, ...hiddenNodes].some(node => node.contains(change.target))) {
1266
- for (let node of change.addedNodes) {
1267
- if (node instanceof HTMLElement && node.dataset.liveAnnouncer === 'true') {
1268
- visibleNodes.add(node);
1269
- } else if (node instanceof Element) {
1270
- hide(node);
1271
- }
1272
- }
1273
- }
1274
- }
1275
- });
1276
- observer.observe(root, {
1277
- childList: true,
1278
- subtree: true
1279
- });
1280
- return () => {
1281
- observer.disconnect();
869
+ var $6cbc0c9bf574473b$exports = {};
870
+ $6cbc0c9bf574473b$exports = JSON.parse("{\"dismiss\":\"Revocare\"}");
1282
871
 
1283
- for (let node of hiddenNodes) {
1284
- let count = $a683bb0d63d5b6f7885c12dcc6f96807$var$refCountMap.get(node);
1285
872
 
1286
- if (count === 1) {
1287
- node.removeAttribute('aria-hidden');
1288
- $a683bb0d63d5b6f7885c12dcc6f96807$var$refCountMap.delete(node);
1289
- } else {
1290
- $a683bb0d63d5b6f7885c12dcc6f96807$var$refCountMap.set(node, count - 1);
1291
- }
873
+ var $009edbe58be6525b$exports = {};
874
+ $009edbe58be6525b$exports = JSON.parse("{\"dismiss\":\"Пропустить\"}");
875
+
876
+
877
+ var $01cf6095489e78f7$exports = {};
878
+ $01cf6095489e78f7$exports = JSON.parse("{\"dismiss\":\"Zrušiť\"}");
879
+
880
+
881
+ var $33fd5a1a3753e83f$exports = {};
882
+ $33fd5a1a3753e83f$exports = JSON.parse("{\"dismiss\":\"Opusti\"}");
883
+
884
+
885
+ var $6b9373a558e74e84$exports = {};
886
+ $6b9373a558e74e84$exports = JSON.parse("{\"dismiss\":\"Odbaci\"}");
887
+
888
+
889
+ var $90008194c3db7fce$exports = {};
890
+ $90008194c3db7fce$exports = JSON.parse("{\"dismiss\":\"Avvisa\"}");
891
+
892
+
893
+ var $e29d21290b4ce15c$exports = {};
894
+ $e29d21290b4ce15c$exports = JSON.parse("{\"dismiss\":\"Kapat\"}");
895
+
896
+
897
+ var $96139c59e8ba3f85$exports = {};
898
+ $96139c59e8ba3f85$exports = JSON.parse("{\"dismiss\":\"Скасувати\"}");
899
+
900
+
901
+ var $052554192ea8e826$exports = {};
902
+ $052554192ea8e826$exports = JSON.parse("{\"dismiss\":\"取消\"}");
903
+
904
+
905
+ var $3f3b5d798a5abdbc$exports = {};
906
+ $3f3b5d798a5abdbc$exports = JSON.parse("{\"dismiss\":\"關閉\"}");
907
+
908
+
909
+ $18d014414048a7ba$exports = {
910
+ "ar-AE": $4393d9b86d3ad278$exports,
911
+ "bg-BG": $254224013ae06959$exports,
912
+ "cs-CZ": $55d3567b59d09782$exports,
913
+ "da-DK": $0e419a7be7773c16$exports,
914
+ "de-DE": $be606513c8356c34$exports,
915
+ "el-GR": $7d99787e5bd26f87$exports,
916
+ "en-US": $0360f2a6534752c1$exports,
917
+ "es-ES": $92bf4fdecfeb6a61$exports,
918
+ "et-EE": $7c02fa9b9c598043$exports,
919
+ "fi-FI": $ba53535dcca59343$exports,
920
+ "fr-FR": $2fbbcddf7d252cb7$exports,
921
+ "he-IL": $0a1f0520e07d3596$exports,
922
+ "hr-HR": $f7be5df1487823a9$exports,
923
+ "hu-HU": $8dbe4363bfbba3f9$exports,
924
+ "it-IT": $90a445da1ad273e7$exports,
925
+ "ja-JP": $e1ebf18259c9b1ee$exports,
926
+ "ko-KR": $765893642f3b4f72$exports,
927
+ "lt-LT": $af73ba24f63febd1$exports,
928
+ "lv-LV": $97aac9f6740ee412$exports,
929
+ "nb-NO": $92fbe76e196d7e0a$exports,
930
+ "nl-NL": $44399897afb701ce$exports,
931
+ "pl-PL": $d679e258664d7384$exports,
932
+ "pt-BR": $b51fc2992648966b$exports,
933
+ "pt-PT": $6abbc540dcd5f78c$exports,
934
+ "ro-RO": $6cbc0c9bf574473b$exports,
935
+ "ru-RU": $009edbe58be6525b$exports,
936
+ "sk-SK": $01cf6095489e78f7$exports,
937
+ "sl-SI": $33fd5a1a3753e83f$exports,
938
+ "sr-SP": $6b9373a558e74e84$exports,
939
+ "sv-SE": $90008194c3db7fce$exports,
940
+ "tr-TR": $e29d21290b4ce15c$exports,
941
+ "uk-UA": $96139c59e8ba3f85$exports,
942
+ "zh-CN": $052554192ea8e826$exports,
943
+ "zh-TW": $3f3b5d798a5abdbc$exports
944
+ };
945
+
946
+
947
+
948
+
949
+
950
+
951
+ function $f69bb3e6457495cc$export$2317d149ed6f78c4(props) {
952
+ let { onDismiss: onDismiss , ...otherProps } = props;
953
+ let formatMessage = $6Zb2x$reactariai18n.useMessageFormatter((/*@__PURE__*/$parcel$interopDefault($18d014414048a7ba$exports)));
954
+ let labels = $6Zb2x$reactariautils.useLabels(otherProps, formatMessage('dismiss'));
955
+ let onClick = ()=>{
956
+ if (onDismiss) onDismiss();
957
+ };
958
+ return(/*#__PURE__*/ ($parcel$interopDefault($6Zb2x$react)).createElement($6Zb2x$reactariavisuallyhidden.VisuallyHidden, null, /*#__PURE__*/ ($parcel$interopDefault($6Zb2x$react)).createElement("button", {
959
+ ...labels,
960
+ tabIndex: -1,
961
+ onClick: onClick
962
+ })));
963
+ }
964
+
965
+
966
+ var $08ef1685902b6011$exports = {};
967
+
968
+ $parcel$export($08ef1685902b6011$exports, "ariaHideOutside", () => $08ef1685902b6011$export$1c3ebcada18427bf);
969
+ /*
970
+ * Copyright 2020 Adobe. All rights reserved.
971
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
972
+ * you may not use this file except in compliance with the License. You may obtain a copy
973
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
974
+ *
975
+ * Unless required by applicable law or agreed to in writing, software distributed under
976
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
977
+ * OF ANY KIND, either express or implied. See the License for the specific language
978
+ * governing permissions and limitations under the License.
979
+ */ // Keeps a ref count of all hidden elements. Added to when hiding an element, and
980
+ // subtracted from when showing it again. When it reaches zero, aria-hidden is removed.
981
+ let $08ef1685902b6011$var$refCountMap = new WeakMap();
982
+ function $08ef1685902b6011$export$1c3ebcada18427bf(targets, root = document.body) {
983
+ let visibleNodes = new Set(targets);
984
+ let hiddenNodes = new Set();
985
+ let walker = document.createTreeWalker(root, NodeFilter.SHOW_ELEMENT, {
986
+ acceptNode (node) {
987
+ // If this node is a live announcer, add it to the set of nodes to keep visible.
988
+ if (node instanceof HTMLElement && node.dataset.liveAnnouncer === 'true') visibleNodes.add(node);
989
+ // Skip this node and its children if it is one of the target nodes, or a live announcer.
990
+ // Also skip children of already hidden nodes, as aria-hidden is recursive.
991
+ if (visibleNodes.has(node) || hiddenNodes.has(node.parentElement)) return NodeFilter.FILTER_REJECT;
992
+ // VoiceOver on iOS has issues hiding elements with role="row". Hide the cells inside instead.
993
+ // https://bugs.webkit.org/show_bug.cgi?id=222623
994
+ if (node instanceof HTMLElement && node.getAttribute('role') === 'row') return NodeFilter.FILTER_SKIP;
995
+ // Skip this node but continue to children if one of the targets is inside the node.
996
+ if (targets.some((target)=>node.contains(target)
997
+ )) return NodeFilter.FILTER_SKIP;
998
+ return NodeFilter.FILTER_ACCEPT;
999
+ }
1000
+ });
1001
+ let hide = (node)=>{
1002
+ var ref;
1003
+ let refCount = (ref = $08ef1685902b6011$var$refCountMap.get(node)) !== null && ref !== void 0 ? ref : 0;
1004
+ // If already aria-hidden, and the ref count is zero, then this element
1005
+ // was already hidden and there's nothing for us to do.
1006
+ if (node.getAttribute('aria-hidden') === 'true' && refCount === 0) return;
1007
+ if (refCount === 0) node.setAttribute('aria-hidden', 'true');
1008
+ hiddenNodes.add(node);
1009
+ $08ef1685902b6011$var$refCountMap.set(node, refCount + 1);
1010
+ };
1011
+ let node1 = walker.nextNode();
1012
+ while(node1 != null){
1013
+ hide(node1);
1014
+ node1 = walker.nextNode();
1292
1015
  }
1293
- };
1016
+ let observer = new MutationObserver((changes)=>{
1017
+ for (let change of changes){
1018
+ if (change.type !== 'childList' || change.addedNodes.length === 0) continue;
1019
+ // If the parent element of the added nodes is not within one of the targets,
1020
+ // and not already inside a hidden node, hide all of the new children.
1021
+ if (![
1022
+ ...visibleNodes,
1023
+ ...hiddenNodes
1024
+ ].some((node)=>node.contains(change.target)
1025
+ )) for (let node2 of change.addedNodes){
1026
+ if (node2 instanceof HTMLElement && node2.dataset.liveAnnouncer === 'true') visibleNodes.add(node2);
1027
+ else if (node2 instanceof Element) hide(node2);
1028
+ }
1029
+ }
1030
+ });
1031
+ observer.observe(root, {
1032
+ childList: true,
1033
+ subtree: true
1034
+ });
1035
+ return ()=>{
1036
+ observer.disconnect();
1037
+ for (let node of hiddenNodes){
1038
+ let count = $08ef1685902b6011$var$refCountMap.get(node);
1039
+ if (count === 1) {
1040
+ node.removeAttribute('aria-hidden');
1041
+ $08ef1685902b6011$var$refCountMap.delete(node);
1042
+ } else $08ef1685902b6011$var$refCountMap.set(node, count - 1);
1043
+ }
1044
+ };
1294
1045
  }
1295
1046
 
1296
- exports.ariaHideOutside = ariaHideOutside;
1047
+
1048
+ $parcel$exportWildcard(module.exports, $cd94b4896dd97759$exports);
1049
+ $parcel$exportWildcard(module.exports, $82711f9cb668ecdb$exports);
1050
+ $parcel$exportWildcard(module.exports, $b4878eb6316f670a$exports);
1051
+ $parcel$exportWildcard(module.exports, $5c2f5cd01815d369$exports);
1052
+ $parcel$exportWildcard(module.exports, $0775ea8ea6a0565e$exports);
1053
+ $parcel$exportWildcard(module.exports, $f69bb3e6457495cc$exports);
1054
+ $parcel$exportWildcard(module.exports, $08ef1685902b6011$exports);
1055
+
1056
+
1297
1057
  //# sourceMappingURL=main.js.map