@dso-toolkit/core 72.0.0 → 72.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (194) hide show
  1. package/dist/cjs/dso-alert.dso-badge.dso-image-overlay.dso-ozon-content.dso-panel.dso-table.entry.cjs.js.map +1 -1
  2. package/dist/cjs/dso-alert_6.cjs.entry.js +5 -5
  3. package/dist/cjs/dso-alert_6.cjs.entry.js.map +1 -1
  4. package/dist/cjs/dso-annotation-locatie.dso-document-component.entry.cjs.js.map +1 -1
  5. package/dist/cjs/dso-annotation-locatie_2.cjs.entry.js +1 -1
  6. package/dist/cjs/dso-annotation-locatie_2.cjs.entry.js.map +1 -1
  7. package/dist/cjs/dso-icon.cjs.entry.js +8 -1
  8. package/dist/cjs/dso-icon.cjs.entry.js.map +1 -1
  9. package/dist/cjs/dso-icon.entry.cjs.js.map +1 -1
  10. package/dist/cjs/dso-info_2.cjs.entry.js +1 -1
  11. package/dist/cjs/dso-label_3.cjs.entry.js +1 -1
  12. package/dist/cjs/dso-map-controls.cjs.entry.js +1 -1
  13. package/dist/cjs/dso-map-controls.cjs.entry.js.map +1 -1
  14. package/dist/cjs/dso-map-controls.entry.cjs.js.map +1 -1
  15. package/dist/cjs/dso-onboarding-tip.cjs.entry.js +1788 -0
  16. package/dist/cjs/dso-onboarding-tip.cjs.entry.js.map +1 -0
  17. package/dist/cjs/dso-onboarding-tip.entry.cjs.js.map +1 -0
  18. package/dist/cjs/dso-plekinfo-card.cjs.entry.js +1 -1
  19. package/dist/cjs/dso-progress-bar.cjs.entry.js +1 -1
  20. package/dist/cjs/dso-progress-indicator.cjs.entry.js +1 -1
  21. package/dist/cjs/dso-project-item.cjs.entry.js +1 -1
  22. package/dist/cjs/dso-responsive-element.cjs.entry.js +1 -1
  23. package/dist/cjs/dso-scrollable.cjs.entry.js +2 -2
  24. package/dist/cjs/dso-skiplink.cjs.entry.js +1 -1
  25. package/dist/cjs/dso-survey-rating.cjs.entry.js +3 -3
  26. package/dist/cjs/dso-survey-rating.cjs.entry.js.map +1 -1
  27. package/dist/cjs/dso-survey-rating.entry.cjs.js.map +1 -1
  28. package/dist/cjs/dso-tabs.cjs.entry.js +1 -1
  29. package/dist/cjs/dso-toggletip.cjs.entry.js +1 -1
  30. package/dist/cjs/dso-toolkit.cjs.js +1 -1
  31. package/dist/cjs/dso-tooltip.cjs.entry.js +1 -1
  32. package/dist/cjs/dso-tree-view.cjs.entry.js +1 -1
  33. package/dist/cjs/dso-viewer-grid.cjs.entry.js +3 -3
  34. package/dist/cjs/dso-viewer-grid.cjs.entry.js.map +1 -1
  35. package/dist/cjs/dso-viewer-grid.entry.cjs.js.map +1 -1
  36. package/dist/cjs/loader.cjs.js +1 -1
  37. package/dist/collection/collection-manifest.json +1 -0
  38. package/dist/collection/components/document-component/document-component.css +24 -24
  39. package/dist/collection/components/icon/icon.js +3 -1
  40. package/dist/collection/components/icon/icon.js.map +1 -1
  41. package/dist/collection/components/image-overlay/image-overlay.css +24 -24
  42. package/dist/collection/components/map-controls/map-controls.css +24 -24
  43. package/dist/collection/components/onboarding-tip/onboarding-tip.css +160 -0
  44. package/dist/collection/components/onboarding-tip/onboarding-tip.interfaces.js +2 -0
  45. package/dist/collection/components/onboarding-tip/onboarding-tip.interfaces.js.map +1 -0
  46. package/dist/collection/components/onboarding-tip/onboarding-tip.js +196 -0
  47. package/dist/collection/components/onboarding-tip/onboarding-tip.js.map +1 -0
  48. package/dist/collection/components/ozon-content/ozon-content.css +24 -24
  49. package/dist/collection/components/ozon-content/ozon-content.js +1 -1
  50. package/dist/collection/components/plekinfo-card/plekinfo-card.js +1 -1
  51. package/dist/collection/components/progress-bar/progress-bar.js +1 -1
  52. package/dist/collection/components/progress-indicator/progress-indicator.js +1 -1
  53. package/dist/collection/components/project-item/project-item.js +1 -1
  54. package/dist/collection/components/responsive-element/responsive-element.js +1 -1
  55. package/dist/collection/components/scrollable/scrollable.js +2 -2
  56. package/dist/collection/components/selectable/selectable.js +1 -1
  57. package/dist/collection/components/skiplink/skiplink.js +1 -1
  58. package/dist/collection/components/slide-toggle/slide-toggle.js +1 -1
  59. package/dist/collection/components/survey-rating/survey-rating.css +12 -12
  60. package/dist/collection/components/survey-rating/survey-rating.js +2 -2
  61. package/dist/collection/components/table/table.css +24 -24
  62. package/dist/collection/components/table/table.js +1 -1
  63. package/dist/collection/components/tabs/tabs.js +1 -1
  64. package/dist/collection/components/toggletip/toggletip.js +1 -1
  65. package/dist/collection/components/tooltip/tooltip.js +1 -1
  66. package/dist/collection/components/tree-view/tree-view.js +1 -1
  67. package/dist/collection/components/viewer-grid/viewer-grid.css +36 -36
  68. package/dist/collection/components/viewer-grid/viewer-grid.js +2 -2
  69. package/dist/components/document-component.js +1 -1
  70. package/dist/components/document-component.js.map +1 -1
  71. package/dist/components/dso-map-controls.js +1 -1
  72. package/dist/components/dso-map-controls.js.map +1 -1
  73. package/dist/components/dso-onboarding-tip.d.ts +11 -0
  74. package/dist/components/dso-onboarding-tip.js +1812 -0
  75. package/dist/components/dso-onboarding-tip.js.map +1 -0
  76. package/dist/components/dso-plekinfo-card.js +1 -1
  77. package/dist/components/dso-progress-bar.js +1 -1
  78. package/dist/components/dso-project-item.js +1 -1
  79. package/dist/components/dso-skiplink.js +1 -1
  80. package/dist/components/dso-survey-rating.js +3 -3
  81. package/dist/components/dso-survey-rating.js.map +1 -1
  82. package/dist/components/dso-tabs.js +1 -1
  83. package/dist/components/dso-tree-view.js +1 -1
  84. package/dist/components/dso-viewer-grid.js +3 -3
  85. package/dist/components/dso-viewer-grid.js.map +1 -1
  86. package/dist/components/icon.js +8 -1
  87. package/dist/components/icon.js.map +1 -1
  88. package/dist/components/image-overlay.js +1 -1
  89. package/dist/components/image-overlay.js.map +1 -1
  90. package/dist/components/index.d.ts +2 -0
  91. package/dist/components/index.js +1 -0
  92. package/dist/components/index.js.map +1 -1
  93. package/dist/components/ozon-content.js +2 -2
  94. package/dist/components/ozon-content.js.map +1 -1
  95. package/dist/components/progress-indicator.js +1 -1
  96. package/dist/components/responsive-element.js +1 -1
  97. package/dist/components/scrollable.js +2 -2
  98. package/dist/components/selectable.js +1 -1
  99. package/dist/components/slide-toggle.js +1 -1
  100. package/dist/components/table.js +2 -2
  101. package/dist/components/table.js.map +1 -1
  102. package/dist/components/toggletip.js +1 -1
  103. package/dist/components/tooltip.js +1 -1
  104. package/dist/dso-toolkit/dso-alert.dso-badge.dso-image-overlay.dso-ozon-content.dso-panel.dso-table.entry.esm.js.map +1 -1
  105. package/dist/dso-toolkit/dso-annotation-locatie.dso-document-component.entry.esm.js.map +1 -1
  106. package/dist/dso-toolkit/dso-icon.entry.esm.js.map +1 -1
  107. package/dist/dso-toolkit/dso-map-controls.entry.esm.js.map +1 -1
  108. package/dist/dso-toolkit/dso-onboarding-tip.entry.esm.js.map +1 -0
  109. package/dist/dso-toolkit/dso-survey-rating.entry.esm.js.map +1 -1
  110. package/dist/dso-toolkit/dso-toolkit.esm.js +1 -1
  111. package/dist/dso-toolkit/dso-viewer-grid.entry.esm.js.map +1 -1
  112. package/dist/dso-toolkit/p-09dcedd1.entry.js +2 -0
  113. package/dist/dso-toolkit/{p-7b715bdf.entry.js.map → p-09dcedd1.entry.js.map} +1 -1
  114. package/dist/dso-toolkit/{p-c13b26ad.entry.js → p-0e6d0886.entry.js} +2 -2
  115. package/dist/dso-toolkit/{p-5f820aec.entry.js → p-13cda4e5.entry.js} +2 -2
  116. package/dist/dso-toolkit/{p-a0a78026.entry.js → p-3315d028.entry.js} +2 -2
  117. package/dist/dso-toolkit/{p-4eefa210.entry.js → p-3aac8417.entry.js} +2 -2
  118. package/dist/dso-toolkit/{p-00580562.entry.js → p-53910728.entry.js} +2 -2
  119. package/dist/dso-toolkit/p-6a620f5f.entry.js +2 -0
  120. package/dist/dso-toolkit/p-6a620f5f.entry.js.map +1 -0
  121. package/dist/dso-toolkit/{p-3f85169a.entry.js → p-6c413b75.entry.js} +2 -2
  122. package/dist/dso-toolkit/{p-6dac4086.entry.js → p-70d63a6a.entry.js} +2 -2
  123. package/dist/dso-toolkit/{p-6dac4086.entry.js.map → p-70d63a6a.entry.js.map} +1 -1
  124. package/dist/dso-toolkit/{p-ac221ee6.entry.js → p-70fc8d65.entry.js} +2 -2
  125. package/dist/dso-toolkit/p-710e1719.entry.js +2 -0
  126. package/dist/dso-toolkit/p-ada03e5c.entry.js +2 -0
  127. package/dist/dso-toolkit/p-ada03e5c.entry.js.map +1 -0
  128. package/dist/dso-toolkit/p-bb88881a.entry.js +2 -0
  129. package/dist/dso-toolkit/{p-6973b064.entry.js → p-c01b6283.entry.js} +2 -2
  130. package/dist/dso-toolkit/{p-896b4e39.entry.js → p-c059397d.entry.js} +2 -2
  131. package/dist/dso-toolkit/{p-c50310e2.entry.js → p-ca14935b.entry.js} +2 -2
  132. package/dist/dso-toolkit/p-ebc43652.entry.js +2 -0
  133. package/dist/dso-toolkit/{p-26d6681e.entry.js.map → p-ebc43652.entry.js.map} +1 -1
  134. package/dist/dso-toolkit/p-ee5df97d.entry.js +2 -0
  135. package/dist/dso-toolkit/{p-43b5e74b.entry.js.map → p-ee5df97d.entry.js.map} +1 -1
  136. package/dist/dso-toolkit/p-ee93ae83.entry.js +2 -0
  137. package/dist/dso-toolkit/{p-3cb4ac7e.entry.js.map → p-ee93ae83.entry.js.map} +1 -1
  138. package/dist/dso-toolkit/{p-7f8fc024.entry.js → p-f6a81839.entry.js} +2 -2
  139. package/dist/esm/dso-alert.dso-badge.dso-image-overlay.dso-ozon-content.dso-panel.dso-table.entry.js.map +1 -1
  140. package/dist/esm/dso-alert_6.entry.js +5 -5
  141. package/dist/esm/dso-alert_6.entry.js.map +1 -1
  142. package/dist/esm/dso-annotation-locatie.dso-document-component.entry.js.map +1 -1
  143. package/dist/esm/dso-annotation-locatie_2.entry.js +1 -1
  144. package/dist/esm/dso-annotation-locatie_2.entry.js.map +1 -1
  145. package/dist/esm/dso-icon.entry.js +8 -1
  146. package/dist/esm/dso-icon.entry.js.map +1 -1
  147. package/dist/esm/dso-info_2.entry.js +1 -1
  148. package/dist/esm/dso-label_3.entry.js +1 -1
  149. package/dist/esm/dso-map-controls.entry.js +1 -1
  150. package/dist/esm/dso-map-controls.entry.js.map +1 -1
  151. package/dist/esm/dso-onboarding-tip.entry.js +1786 -0
  152. package/dist/esm/dso-onboarding-tip.entry.js.map +1 -0
  153. package/dist/esm/dso-plekinfo-card.entry.js +1 -1
  154. package/dist/esm/dso-progress-bar.entry.js +1 -1
  155. package/dist/esm/dso-progress-indicator.entry.js +1 -1
  156. package/dist/esm/dso-project-item.entry.js +1 -1
  157. package/dist/esm/dso-responsive-element.entry.js +1 -1
  158. package/dist/esm/dso-scrollable.entry.js +2 -2
  159. package/dist/esm/dso-skiplink.entry.js +1 -1
  160. package/dist/esm/dso-survey-rating.entry.js +3 -3
  161. package/dist/esm/dso-survey-rating.entry.js.map +1 -1
  162. package/dist/esm/dso-tabs.entry.js +1 -1
  163. package/dist/esm/dso-toggletip.entry.js +1 -1
  164. package/dist/esm/dso-toolkit.js +1 -1
  165. package/dist/esm/dso-tooltip.entry.js +1 -1
  166. package/dist/esm/dso-tree-view.entry.js +1 -1
  167. package/dist/esm/dso-viewer-grid.entry.js +3 -3
  168. package/dist/esm/dso-viewer-grid.entry.js.map +1 -1
  169. package/dist/esm/loader.js +1 -1
  170. package/dist/types/components/onboarding-tip/onboarding-tip.d.ts +25 -0
  171. package/dist/types/components/onboarding-tip/onboarding-tip.interfaces.d.ts +4 -0
  172. package/dist/types/components.d.ts +42 -0
  173. package/package.json +4 -3
  174. package/dist/dso-toolkit/p-26d6681e.entry.js +0 -2
  175. package/dist/dso-toolkit/p-3cb4ac7e.entry.js +0 -2
  176. package/dist/dso-toolkit/p-43b5e74b.entry.js +0 -2
  177. package/dist/dso-toolkit/p-7853e0ff.entry.js +0 -2
  178. package/dist/dso-toolkit/p-7b715bdf.entry.js +0 -2
  179. package/dist/dso-toolkit/p-a74dabd9.entry.js +0 -2
  180. package/dist/dso-toolkit/p-a74dabd9.entry.js.map +0 -1
  181. package/dist/dso-toolkit/p-b26fded2.entry.js +0 -2
  182. /package/dist/dso-toolkit/{p-c13b26ad.entry.js.map → p-0e6d0886.entry.js.map} +0 -0
  183. /package/dist/dso-toolkit/{p-5f820aec.entry.js.map → p-13cda4e5.entry.js.map} +0 -0
  184. /package/dist/dso-toolkit/{p-a0a78026.entry.js.map → p-3315d028.entry.js.map} +0 -0
  185. /package/dist/dso-toolkit/{p-4eefa210.entry.js.map → p-3aac8417.entry.js.map} +0 -0
  186. /package/dist/dso-toolkit/{p-00580562.entry.js.map → p-53910728.entry.js.map} +0 -0
  187. /package/dist/dso-toolkit/{p-3f85169a.entry.js.map → p-6c413b75.entry.js.map} +0 -0
  188. /package/dist/dso-toolkit/{p-ac221ee6.entry.js.map → p-70fc8d65.entry.js.map} +0 -0
  189. /package/dist/dso-toolkit/{p-7853e0ff.entry.js.map → p-710e1719.entry.js.map} +0 -0
  190. /package/dist/dso-toolkit/{p-b26fded2.entry.js.map → p-bb88881a.entry.js.map} +0 -0
  191. /package/dist/dso-toolkit/{p-6973b064.entry.js.map → p-c01b6283.entry.js.map} +0 -0
  192. /package/dist/dso-toolkit/{p-896b4e39.entry.js.map → p-c059397d.entry.js.map} +0 -0
  193. /package/dist/dso-toolkit/{p-c50310e2.entry.js.map → p-ca14935b.entry.js.map} +0 -0
  194. /package/dist/dso-toolkit/{p-7f8fc024.entry.js.map → p-f6a81839.entry.js.map} +0 -0
@@ -0,0 +1,1788 @@
1
+ 'use strict';
2
+
3
+ var index = require('./index-CkTcEJuV.js');
4
+
5
+ /**
6
+ * Custom positioning reference element.
7
+ * @see https://floating-ui.com/docs/virtual-elements
8
+ */
9
+
10
+ const sides = ['top', 'right', 'bottom', 'left'];
11
+ const min = Math.min;
12
+ const max = Math.max;
13
+ const round = Math.round;
14
+ const floor = Math.floor;
15
+ const createCoords = v => ({
16
+ x: v,
17
+ y: v
18
+ });
19
+ const oppositeSideMap = {
20
+ left: 'right',
21
+ right: 'left',
22
+ bottom: 'top',
23
+ top: 'bottom'
24
+ };
25
+ const oppositeAlignmentMap = {
26
+ start: 'end',
27
+ end: 'start'
28
+ };
29
+ function clamp(start, value, end) {
30
+ return max(start, min(value, end));
31
+ }
32
+ function evaluate(value, param) {
33
+ return typeof value === 'function' ? value(param) : value;
34
+ }
35
+ function getSide(placement) {
36
+ return placement.split('-')[0];
37
+ }
38
+ function getAlignment(placement) {
39
+ return placement.split('-')[1];
40
+ }
41
+ function getOppositeAxis(axis) {
42
+ return axis === 'x' ? 'y' : 'x';
43
+ }
44
+ function getAxisLength(axis) {
45
+ return axis === 'y' ? 'height' : 'width';
46
+ }
47
+ function getSideAxis(placement) {
48
+ return ['top', 'bottom'].includes(getSide(placement)) ? 'y' : 'x';
49
+ }
50
+ function getAlignmentAxis(placement) {
51
+ return getOppositeAxis(getSideAxis(placement));
52
+ }
53
+ function getAlignmentSides(placement, rects, rtl) {
54
+ if (rtl === void 0) {
55
+ rtl = false;
56
+ }
57
+ const alignment = getAlignment(placement);
58
+ const alignmentAxis = getAlignmentAxis(placement);
59
+ const length = getAxisLength(alignmentAxis);
60
+ let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
61
+ if (rects.reference[length] > rects.floating[length]) {
62
+ mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
63
+ }
64
+ return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
65
+ }
66
+ function getExpandedPlacements(placement) {
67
+ const oppositePlacement = getOppositePlacement(placement);
68
+ return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
69
+ }
70
+ function getOppositeAlignmentPlacement(placement) {
71
+ return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
72
+ }
73
+ function getSideList(side, isStart, rtl) {
74
+ const lr = ['left', 'right'];
75
+ const rl = ['right', 'left'];
76
+ const tb = ['top', 'bottom'];
77
+ const bt = ['bottom', 'top'];
78
+ switch (side) {
79
+ case 'top':
80
+ case 'bottom':
81
+ if (rtl) return isStart ? rl : lr;
82
+ return isStart ? lr : rl;
83
+ case 'left':
84
+ case 'right':
85
+ return isStart ? tb : bt;
86
+ default:
87
+ return [];
88
+ }
89
+ }
90
+ function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
91
+ const alignment = getAlignment(placement);
92
+ let list = getSideList(getSide(placement), direction === 'start', rtl);
93
+ if (alignment) {
94
+ list = list.map(side => side + "-" + alignment);
95
+ if (flipAlignment) {
96
+ list = list.concat(list.map(getOppositeAlignmentPlacement));
97
+ }
98
+ }
99
+ return list;
100
+ }
101
+ function getOppositePlacement(placement) {
102
+ return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);
103
+ }
104
+ function expandPaddingObject(padding) {
105
+ return {
106
+ top: 0,
107
+ right: 0,
108
+ bottom: 0,
109
+ left: 0,
110
+ ...padding
111
+ };
112
+ }
113
+ function getPaddingObject(padding) {
114
+ return typeof padding !== 'number' ? expandPaddingObject(padding) : {
115
+ top: padding,
116
+ right: padding,
117
+ bottom: padding,
118
+ left: padding
119
+ };
120
+ }
121
+ function rectToClientRect(rect) {
122
+ const {
123
+ x,
124
+ y,
125
+ width,
126
+ height
127
+ } = rect;
128
+ return {
129
+ width,
130
+ height,
131
+ top: y,
132
+ left: x,
133
+ right: x + width,
134
+ bottom: y + height,
135
+ x,
136
+ y
137
+ };
138
+ }
139
+
140
+ function computeCoordsFromPlacement(_ref, placement, rtl) {
141
+ let {
142
+ reference,
143
+ floating
144
+ } = _ref;
145
+ const sideAxis = getSideAxis(placement);
146
+ const alignmentAxis = getAlignmentAxis(placement);
147
+ const alignLength = getAxisLength(alignmentAxis);
148
+ const side = getSide(placement);
149
+ const isVertical = sideAxis === 'y';
150
+ const commonX = reference.x + reference.width / 2 - floating.width / 2;
151
+ const commonY = reference.y + reference.height / 2 - floating.height / 2;
152
+ const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
153
+ let coords;
154
+ switch (side) {
155
+ case 'top':
156
+ coords = {
157
+ x: commonX,
158
+ y: reference.y - floating.height
159
+ };
160
+ break;
161
+ case 'bottom':
162
+ coords = {
163
+ x: commonX,
164
+ y: reference.y + reference.height
165
+ };
166
+ break;
167
+ case 'right':
168
+ coords = {
169
+ x: reference.x + reference.width,
170
+ y: commonY
171
+ };
172
+ break;
173
+ case 'left':
174
+ coords = {
175
+ x: reference.x - floating.width,
176
+ y: commonY
177
+ };
178
+ break;
179
+ default:
180
+ coords = {
181
+ x: reference.x,
182
+ y: reference.y
183
+ };
184
+ }
185
+ switch (getAlignment(placement)) {
186
+ case 'start':
187
+ coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
188
+ break;
189
+ case 'end':
190
+ coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
191
+ break;
192
+ }
193
+ return coords;
194
+ }
195
+
196
+ /**
197
+ * Computes the `x` and `y` coordinates that will place the floating element
198
+ * next to a given reference element.
199
+ *
200
+ * This export does not have any `platform` interface logic. You will need to
201
+ * write one for the platform you are using Floating UI with.
202
+ */
203
+ const computePosition$1 = async (reference, floating, config) => {
204
+ const {
205
+ placement = 'bottom',
206
+ strategy = 'absolute',
207
+ middleware = [],
208
+ platform
209
+ } = config;
210
+ const validMiddleware = middleware.filter(Boolean);
211
+ const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
212
+ let rects = await platform.getElementRects({
213
+ reference,
214
+ floating,
215
+ strategy
216
+ });
217
+ let {
218
+ x,
219
+ y
220
+ } = computeCoordsFromPlacement(rects, placement, rtl);
221
+ let statefulPlacement = placement;
222
+ let middlewareData = {};
223
+ let resetCount = 0;
224
+ for (let i = 0; i < validMiddleware.length; i++) {
225
+ const {
226
+ name,
227
+ fn
228
+ } = validMiddleware[i];
229
+ const {
230
+ x: nextX,
231
+ y: nextY,
232
+ data,
233
+ reset
234
+ } = await fn({
235
+ x,
236
+ y,
237
+ initialPlacement: placement,
238
+ placement: statefulPlacement,
239
+ strategy,
240
+ middlewareData,
241
+ rects,
242
+ platform,
243
+ elements: {
244
+ reference,
245
+ floating
246
+ }
247
+ });
248
+ x = nextX != null ? nextX : x;
249
+ y = nextY != null ? nextY : y;
250
+ middlewareData = {
251
+ ...middlewareData,
252
+ [name]: {
253
+ ...middlewareData[name],
254
+ ...data
255
+ }
256
+ };
257
+ if (reset && resetCount <= 50) {
258
+ resetCount++;
259
+ if (typeof reset === 'object') {
260
+ if (reset.placement) {
261
+ statefulPlacement = reset.placement;
262
+ }
263
+ if (reset.rects) {
264
+ rects = reset.rects === true ? await platform.getElementRects({
265
+ reference,
266
+ floating,
267
+ strategy
268
+ }) : reset.rects;
269
+ }
270
+ ({
271
+ x,
272
+ y
273
+ } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
274
+ }
275
+ i = -1;
276
+ }
277
+ }
278
+ return {
279
+ x,
280
+ y,
281
+ placement: statefulPlacement,
282
+ strategy,
283
+ middlewareData
284
+ };
285
+ };
286
+
287
+ /**
288
+ * Resolves with an object of overflow side offsets that determine how much the
289
+ * element is overflowing a given clipping boundary on each side.
290
+ * - positive = overflowing the boundary by that number of pixels
291
+ * - negative = how many pixels left before it will overflow
292
+ * - 0 = lies flush with the boundary
293
+ * @see https://floating-ui.com/docs/detectOverflow
294
+ */
295
+ async function detectOverflow(state, options) {
296
+ var _await$platform$isEle;
297
+ if (options === void 0) {
298
+ options = {};
299
+ }
300
+ const {
301
+ x,
302
+ y,
303
+ platform,
304
+ rects,
305
+ elements,
306
+ strategy
307
+ } = state;
308
+ const {
309
+ boundary = 'clippingAncestors',
310
+ rootBoundary = 'viewport',
311
+ elementContext = 'floating',
312
+ altBoundary = false,
313
+ padding = 0
314
+ } = evaluate(options, state);
315
+ const paddingObject = getPaddingObject(padding);
316
+ const altContext = elementContext === 'floating' ? 'reference' : 'floating';
317
+ const element = elements[altBoundary ? altContext : elementContext];
318
+ const clippingClientRect = rectToClientRect(await platform.getClippingRect({
319
+ element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
320
+ boundary,
321
+ rootBoundary,
322
+ strategy
323
+ }));
324
+ const rect = elementContext === 'floating' ? {
325
+ x,
326
+ y,
327
+ width: rects.floating.width,
328
+ height: rects.floating.height
329
+ } : rects.reference;
330
+ const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
331
+ const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
332
+ x: 1,
333
+ y: 1
334
+ } : {
335
+ x: 1,
336
+ y: 1
337
+ };
338
+ const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
339
+ elements,
340
+ rect,
341
+ offsetParent,
342
+ strategy
343
+ }) : rect);
344
+ return {
345
+ top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
346
+ bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
347
+ left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
348
+ right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
349
+ };
350
+ }
351
+
352
+ /**
353
+ * Provides data to position an inner element of the floating element so that it
354
+ * appears centered to the reference element.
355
+ * @see https://floating-ui.com/docs/arrow
356
+ */
357
+ const arrow$1 = options => ({
358
+ name: 'arrow',
359
+ options,
360
+ async fn(state) {
361
+ const {
362
+ x,
363
+ y,
364
+ placement,
365
+ rects,
366
+ platform,
367
+ elements,
368
+ middlewareData
369
+ } = state;
370
+ // Since `element` is required, we don't Partial<> the type.
371
+ const {
372
+ element,
373
+ padding = 0
374
+ } = evaluate(options, state) || {};
375
+ if (element == null) {
376
+ return {};
377
+ }
378
+ const paddingObject = getPaddingObject(padding);
379
+ const coords = {
380
+ x,
381
+ y
382
+ };
383
+ const axis = getAlignmentAxis(placement);
384
+ const length = getAxisLength(axis);
385
+ const arrowDimensions = await platform.getDimensions(element);
386
+ const isYAxis = axis === 'y';
387
+ const minProp = isYAxis ? 'top' : 'left';
388
+ const maxProp = isYAxis ? 'bottom' : 'right';
389
+ const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';
390
+ const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
391
+ const startDiff = coords[axis] - rects.reference[axis];
392
+ const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));
393
+ let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
394
+
395
+ // DOM platform can return `window` as the `offsetParent`.
396
+ if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {
397
+ clientSize = elements.floating[clientProp] || rects.floating[length];
398
+ }
399
+ const centerToReference = endDiff / 2 - startDiff / 2;
400
+
401
+ // If the padding is large enough that it causes the arrow to no longer be
402
+ // centered, modify the padding so that it is centered.
403
+ const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
404
+ const minPadding = min(paddingObject[minProp], largestPossiblePadding);
405
+ const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);
406
+
407
+ // Make sure the arrow doesn't overflow the floating element if the center
408
+ // point is outside the floating element's bounds.
409
+ const min$1 = minPadding;
410
+ const max = clientSize - arrowDimensions[length] - maxPadding;
411
+ const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
412
+ const offset = clamp(min$1, center, max);
413
+
414
+ // If the reference is small enough that the arrow's padding causes it to
415
+ // to point to nothing for an aligned placement, adjust the offset of the
416
+ // floating element itself. To ensure `shift()` continues to take action,
417
+ // a single reset is performed when this is true.
418
+ const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
419
+ const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;
420
+ return {
421
+ [axis]: coords[axis] + alignmentOffset,
422
+ data: {
423
+ [axis]: offset,
424
+ centerOffset: center - offset - alignmentOffset,
425
+ ...(shouldAddOffset && {
426
+ alignmentOffset
427
+ })
428
+ },
429
+ reset: shouldAddOffset
430
+ };
431
+ }
432
+ });
433
+
434
+ /**
435
+ * Optimizes the visibility of the floating element by flipping the `placement`
436
+ * in order to keep it in view when the preferred placement(s) will overflow the
437
+ * clipping boundary. Alternative to `autoPlacement`.
438
+ * @see https://floating-ui.com/docs/flip
439
+ */
440
+ const flip$1 = function (options) {
441
+ if (options === void 0) {
442
+ options = {};
443
+ }
444
+ return {
445
+ name: 'flip',
446
+ options,
447
+ async fn(state) {
448
+ var _middlewareData$arrow, _middlewareData$flip;
449
+ const {
450
+ placement,
451
+ middlewareData,
452
+ rects,
453
+ initialPlacement,
454
+ platform,
455
+ elements
456
+ } = state;
457
+ const {
458
+ mainAxis: checkMainAxis = true,
459
+ crossAxis: checkCrossAxis = true,
460
+ fallbackPlacements: specifiedFallbackPlacements,
461
+ fallbackStrategy = 'bestFit',
462
+ fallbackAxisSideDirection = 'none',
463
+ flipAlignment = true,
464
+ ...detectOverflowOptions
465
+ } = evaluate(options, state);
466
+
467
+ // If a reset by the arrow was caused due to an alignment offset being
468
+ // added, we should skip any logic now since `flip()` has already done its
469
+ // work.
470
+ // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643
471
+ if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
472
+ return {};
473
+ }
474
+ const side = getSide(placement);
475
+ const initialSideAxis = getSideAxis(initialPlacement);
476
+ const isBasePlacement = getSide(initialPlacement) === initialPlacement;
477
+ const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
478
+ const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
479
+ const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';
480
+ if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
481
+ fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
482
+ }
483
+ const placements = [initialPlacement, ...fallbackPlacements];
484
+ const overflow = await detectOverflow(state, detectOverflowOptions);
485
+ const overflows = [];
486
+ let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
487
+ if (checkMainAxis) {
488
+ overflows.push(overflow[side]);
489
+ }
490
+ if (checkCrossAxis) {
491
+ const sides = getAlignmentSides(placement, rects, rtl);
492
+ overflows.push(overflow[sides[0]], overflow[sides[1]]);
493
+ }
494
+ overflowsData = [...overflowsData, {
495
+ placement,
496
+ overflows
497
+ }];
498
+
499
+ // One or more sides is overflowing.
500
+ if (!overflows.every(side => side <= 0)) {
501
+ var _middlewareData$flip2, _overflowsData$filter;
502
+ const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
503
+ const nextPlacement = placements[nextIndex];
504
+ if (nextPlacement) {
505
+ // Try next placement and re-run the lifecycle.
506
+ return {
507
+ data: {
508
+ index: nextIndex,
509
+ overflows: overflowsData
510
+ },
511
+ reset: {
512
+ placement: nextPlacement
513
+ }
514
+ };
515
+ }
516
+
517
+ // First, find the candidates that fit on the mainAxis side of overflow,
518
+ // then find the placement that fits the best on the main crossAxis side.
519
+ let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
520
+
521
+ // Otherwise fallback.
522
+ if (!resetPlacement) {
523
+ switch (fallbackStrategy) {
524
+ case 'bestFit':
525
+ {
526
+ var _overflowsData$filter2;
527
+ const placement = (_overflowsData$filter2 = overflowsData.filter(d => {
528
+ if (hasFallbackAxisSideDirection) {
529
+ const currentSideAxis = getSideAxis(d.placement);
530
+ return currentSideAxis === initialSideAxis ||
531
+ // Create a bias to the `y` side axis due to horizontal
532
+ // reading directions favoring greater width.
533
+ currentSideAxis === 'y';
534
+ }
535
+ return true;
536
+ }).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
537
+ if (placement) {
538
+ resetPlacement = placement;
539
+ }
540
+ break;
541
+ }
542
+ case 'initialPlacement':
543
+ resetPlacement = initialPlacement;
544
+ break;
545
+ }
546
+ }
547
+ if (placement !== resetPlacement) {
548
+ return {
549
+ reset: {
550
+ placement: resetPlacement
551
+ }
552
+ };
553
+ }
554
+ }
555
+ return {};
556
+ }
557
+ };
558
+ };
559
+
560
+ function getSideOffsets(overflow, rect) {
561
+ return {
562
+ top: overflow.top - rect.height,
563
+ right: overflow.right - rect.width,
564
+ bottom: overflow.bottom - rect.height,
565
+ left: overflow.left - rect.width
566
+ };
567
+ }
568
+ function isAnySideFullyClipped(overflow) {
569
+ return sides.some(side => overflow[side] >= 0);
570
+ }
571
+ /**
572
+ * Provides data to hide the floating element in applicable situations, such as
573
+ * when it is not in the same clipping context as the reference element.
574
+ * @see https://floating-ui.com/docs/hide
575
+ */
576
+ const hide$1 = function (options) {
577
+ if (options === void 0) {
578
+ options = {};
579
+ }
580
+ return {
581
+ name: 'hide',
582
+ options,
583
+ async fn(state) {
584
+ const {
585
+ rects
586
+ } = state;
587
+ const {
588
+ strategy = 'referenceHidden',
589
+ ...detectOverflowOptions
590
+ } = evaluate(options, state);
591
+ switch (strategy) {
592
+ case 'referenceHidden':
593
+ {
594
+ const overflow = await detectOverflow(state, {
595
+ ...detectOverflowOptions,
596
+ elementContext: 'reference'
597
+ });
598
+ const offsets = getSideOffsets(overflow, rects.reference);
599
+ return {
600
+ data: {
601
+ referenceHiddenOffsets: offsets,
602
+ referenceHidden: isAnySideFullyClipped(offsets)
603
+ }
604
+ };
605
+ }
606
+ case 'escaped':
607
+ {
608
+ const overflow = await detectOverflow(state, {
609
+ ...detectOverflowOptions,
610
+ altBoundary: true
611
+ });
612
+ const offsets = getSideOffsets(overflow, rects.floating);
613
+ return {
614
+ data: {
615
+ escapedOffsets: offsets,
616
+ escaped: isAnySideFullyClipped(offsets)
617
+ }
618
+ };
619
+ }
620
+ default:
621
+ {
622
+ return {};
623
+ }
624
+ }
625
+ }
626
+ };
627
+ };
628
+
629
+ // For type backwards-compatibility, the `OffsetOptions` type was also
630
+ // Derivable.
631
+
632
+ async function convertValueToCoords(state, options) {
633
+ const {
634
+ placement,
635
+ platform,
636
+ elements
637
+ } = state;
638
+ const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
639
+ const side = getSide(placement);
640
+ const alignment = getAlignment(placement);
641
+ const isVertical = getSideAxis(placement) === 'y';
642
+ const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
643
+ const crossAxisMulti = rtl && isVertical ? -1 : 1;
644
+ const rawValue = evaluate(options, state);
645
+
646
+ // eslint-disable-next-line prefer-const
647
+ let {
648
+ mainAxis,
649
+ crossAxis,
650
+ alignmentAxis
651
+ } = typeof rawValue === 'number' ? {
652
+ mainAxis: rawValue,
653
+ crossAxis: 0,
654
+ alignmentAxis: null
655
+ } : {
656
+ mainAxis: rawValue.mainAxis || 0,
657
+ crossAxis: rawValue.crossAxis || 0,
658
+ alignmentAxis: rawValue.alignmentAxis
659
+ };
660
+ if (alignment && typeof alignmentAxis === 'number') {
661
+ crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
662
+ }
663
+ return isVertical ? {
664
+ x: crossAxis * crossAxisMulti,
665
+ y: mainAxis * mainAxisMulti
666
+ } : {
667
+ x: mainAxis * mainAxisMulti,
668
+ y: crossAxis * crossAxisMulti
669
+ };
670
+ }
671
+
672
+ /**
673
+ * Modifies the placement by translating the floating element along the
674
+ * specified axes.
675
+ * A number (shorthand for `mainAxis` or distance), or an axes configuration
676
+ * object may be passed.
677
+ * @see https://floating-ui.com/docs/offset
678
+ */
679
+ const offset$1 = function (options) {
680
+ if (options === void 0) {
681
+ options = 0;
682
+ }
683
+ return {
684
+ name: 'offset',
685
+ options,
686
+ async fn(state) {
687
+ var _middlewareData$offse, _middlewareData$arrow;
688
+ const {
689
+ x,
690
+ y,
691
+ placement,
692
+ middlewareData
693
+ } = state;
694
+ const diffCoords = await convertValueToCoords(state, options);
695
+
696
+ // If the placement is the same and the arrow caused an alignment offset
697
+ // then we don't need to change the positioning coordinates.
698
+ if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
699
+ return {};
700
+ }
701
+ return {
702
+ x: x + diffCoords.x,
703
+ y: y + diffCoords.y,
704
+ data: {
705
+ ...diffCoords,
706
+ placement
707
+ }
708
+ };
709
+ }
710
+ };
711
+ };
712
+
713
+ /**
714
+ * Optimizes the visibility of the floating element by shifting it in order to
715
+ * keep it in view when it will overflow the clipping boundary.
716
+ * @see https://floating-ui.com/docs/shift
717
+ */
718
+ const shift$1 = function (options) {
719
+ if (options === void 0) {
720
+ options = {};
721
+ }
722
+ return {
723
+ name: 'shift',
724
+ options,
725
+ async fn(state) {
726
+ const {
727
+ x,
728
+ y,
729
+ placement
730
+ } = state;
731
+ const {
732
+ mainAxis: checkMainAxis = true,
733
+ crossAxis: checkCrossAxis = false,
734
+ limiter = {
735
+ fn: _ref => {
736
+ let {
737
+ x,
738
+ y
739
+ } = _ref;
740
+ return {
741
+ x,
742
+ y
743
+ };
744
+ }
745
+ },
746
+ ...detectOverflowOptions
747
+ } = evaluate(options, state);
748
+ const coords = {
749
+ x,
750
+ y
751
+ };
752
+ const overflow = await detectOverflow(state, detectOverflowOptions);
753
+ const crossAxis = getSideAxis(getSide(placement));
754
+ const mainAxis = getOppositeAxis(crossAxis);
755
+ let mainAxisCoord = coords[mainAxis];
756
+ let crossAxisCoord = coords[crossAxis];
757
+ if (checkMainAxis) {
758
+ const minSide = mainAxis === 'y' ? 'top' : 'left';
759
+ const maxSide = mainAxis === 'y' ? 'bottom' : 'right';
760
+ const min = mainAxisCoord + overflow[minSide];
761
+ const max = mainAxisCoord - overflow[maxSide];
762
+ mainAxisCoord = clamp(min, mainAxisCoord, max);
763
+ }
764
+ if (checkCrossAxis) {
765
+ const minSide = crossAxis === 'y' ? 'top' : 'left';
766
+ const maxSide = crossAxis === 'y' ? 'bottom' : 'right';
767
+ const min = crossAxisCoord + overflow[minSide];
768
+ const max = crossAxisCoord - overflow[maxSide];
769
+ crossAxisCoord = clamp(min, crossAxisCoord, max);
770
+ }
771
+ const limitedCoords = limiter.fn({
772
+ ...state,
773
+ [mainAxis]: mainAxisCoord,
774
+ [crossAxis]: crossAxisCoord
775
+ });
776
+ return {
777
+ ...limitedCoords,
778
+ data: {
779
+ x: limitedCoords.x - x,
780
+ y: limitedCoords.y - y,
781
+ enabled: {
782
+ [mainAxis]: checkMainAxis,
783
+ [crossAxis]: checkCrossAxis
784
+ }
785
+ }
786
+ };
787
+ }
788
+ };
789
+ };
790
+
791
+ function hasWindow() {
792
+ return typeof window !== 'undefined';
793
+ }
794
+ function getNodeName(node) {
795
+ if (isNode(node)) {
796
+ return (node.nodeName || '').toLowerCase();
797
+ }
798
+ // Mocked nodes in testing environments may not be instances of Node. By
799
+ // returning `#document` an infinite loop won't occur.
800
+ // https://github.com/floating-ui/floating-ui/issues/2317
801
+ return '#document';
802
+ }
803
+ function getWindow(node) {
804
+ var _node$ownerDocument;
805
+ return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
806
+ }
807
+ function getDocumentElement(node) {
808
+ var _ref;
809
+ return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
810
+ }
811
+ function isNode(value) {
812
+ if (!hasWindow()) {
813
+ return false;
814
+ }
815
+ return value instanceof Node || value instanceof getWindow(value).Node;
816
+ }
817
+ function isElement(value) {
818
+ if (!hasWindow()) {
819
+ return false;
820
+ }
821
+ return value instanceof Element || value instanceof getWindow(value).Element;
822
+ }
823
+ function isHTMLElement(value) {
824
+ if (!hasWindow()) {
825
+ return false;
826
+ }
827
+ return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
828
+ }
829
+ function isShadowRoot(value) {
830
+ if (!hasWindow() || typeof ShadowRoot === 'undefined') {
831
+ return false;
832
+ }
833
+ return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
834
+ }
835
+ function isOverflowElement(element) {
836
+ const {
837
+ overflow,
838
+ overflowX,
839
+ overflowY,
840
+ display
841
+ } = getComputedStyle(element);
842
+ return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
843
+ }
844
+ function isTableElement(element) {
845
+ return ['table', 'td', 'th'].includes(getNodeName(element));
846
+ }
847
+ function isTopLayer(element) {
848
+ return [':popover-open', ':modal'].some(selector => {
849
+ try {
850
+ return element.matches(selector);
851
+ } catch (e) {
852
+ return false;
853
+ }
854
+ });
855
+ }
856
+ function isContainingBlock(elementOrCss) {
857
+ const webkit = isWebKit();
858
+ const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;
859
+
860
+ // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
861
+ // https://drafts.csswg.org/css-transforms-2/#individual-transforms
862
+ return ['transform', 'translate', 'scale', 'rotate', 'perspective'].some(value => css[value] ? css[value] !== 'none' : false) || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value));
863
+ }
864
+ function getContainingBlock(element) {
865
+ let currentNode = getParentNode(element);
866
+ while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
867
+ if (isContainingBlock(currentNode)) {
868
+ return currentNode;
869
+ } else if (isTopLayer(currentNode)) {
870
+ return null;
871
+ }
872
+ currentNode = getParentNode(currentNode);
873
+ }
874
+ return null;
875
+ }
876
+ function isWebKit() {
877
+ if (typeof CSS === 'undefined' || !CSS.supports) return false;
878
+ return CSS.supports('-webkit-backdrop-filter', 'none');
879
+ }
880
+ function isLastTraversableNode(node) {
881
+ return ['html', 'body', '#document'].includes(getNodeName(node));
882
+ }
883
+ function getComputedStyle(element) {
884
+ return getWindow(element).getComputedStyle(element);
885
+ }
886
+ function getNodeScroll(element) {
887
+ if (isElement(element)) {
888
+ return {
889
+ scrollLeft: element.scrollLeft,
890
+ scrollTop: element.scrollTop
891
+ };
892
+ }
893
+ return {
894
+ scrollLeft: element.scrollX,
895
+ scrollTop: element.scrollY
896
+ };
897
+ }
898
+ function getParentNode(node) {
899
+ if (getNodeName(node) === 'html') {
900
+ return node;
901
+ }
902
+ const result =
903
+ // Step into the shadow DOM of the parent of a slotted node.
904
+ node.assignedSlot ||
905
+ // DOM Element detected.
906
+ node.parentNode ||
907
+ // ShadowRoot detected.
908
+ isShadowRoot(node) && node.host ||
909
+ // Fallback.
910
+ getDocumentElement(node);
911
+ return isShadowRoot(result) ? result.host : result;
912
+ }
913
+ function getNearestOverflowAncestor(node) {
914
+ const parentNode = getParentNode(node);
915
+ if (isLastTraversableNode(parentNode)) {
916
+ return node.ownerDocument ? node.ownerDocument.body : node.body;
917
+ }
918
+ if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
919
+ return parentNode;
920
+ }
921
+ return getNearestOverflowAncestor(parentNode);
922
+ }
923
+ function getOverflowAncestors(node, list, traverseIframes) {
924
+ var _node$ownerDocument2;
925
+ if (list === void 0) {
926
+ list = [];
927
+ }
928
+ if (traverseIframes === void 0) {
929
+ traverseIframes = true;
930
+ }
931
+ const scrollableAncestor = getNearestOverflowAncestor(node);
932
+ const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
933
+ const win = getWindow(scrollableAncestor);
934
+ if (isBody) {
935
+ const frameElement = getFrameElement(win);
936
+ return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
937
+ }
938
+ return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
939
+ }
940
+ function getFrameElement(win) {
941
+ return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
942
+ }
943
+
944
+ function getCssDimensions(element) {
945
+ const css = getComputedStyle(element);
946
+ // In testing environments, the `width` and `height` properties are empty
947
+ // strings for SVG elements, returning NaN. Fallback to `0` in this case.
948
+ let width = parseFloat(css.width) || 0;
949
+ let height = parseFloat(css.height) || 0;
950
+ const hasOffset = isHTMLElement(element);
951
+ const offsetWidth = hasOffset ? element.offsetWidth : width;
952
+ const offsetHeight = hasOffset ? element.offsetHeight : height;
953
+ const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
954
+ if (shouldFallback) {
955
+ width = offsetWidth;
956
+ height = offsetHeight;
957
+ }
958
+ return {
959
+ width,
960
+ height,
961
+ $: shouldFallback
962
+ };
963
+ }
964
+
965
+ function unwrapElement(element) {
966
+ return !isElement(element) ? element.contextElement : element;
967
+ }
968
+
969
+ function getScale(element) {
970
+ const domElement = unwrapElement(element);
971
+ if (!isHTMLElement(domElement)) {
972
+ return createCoords(1);
973
+ }
974
+ const rect = domElement.getBoundingClientRect();
975
+ const {
976
+ width,
977
+ height,
978
+ $
979
+ } = getCssDimensions(domElement);
980
+ let x = ($ ? round(rect.width) : rect.width) / width;
981
+ let y = ($ ? round(rect.height) : rect.height) / height;
982
+
983
+ // 0, NaN, or Infinity should always fallback to 1.
984
+
985
+ if (!x || !Number.isFinite(x)) {
986
+ x = 1;
987
+ }
988
+ if (!y || !Number.isFinite(y)) {
989
+ y = 1;
990
+ }
991
+ return {
992
+ x,
993
+ y
994
+ };
995
+ }
996
+
997
+ const noOffsets = /*#__PURE__*/createCoords(0);
998
+ function getVisualOffsets(element) {
999
+ const win = getWindow(element);
1000
+ if (!isWebKit() || !win.visualViewport) {
1001
+ return noOffsets;
1002
+ }
1003
+ return {
1004
+ x: win.visualViewport.offsetLeft,
1005
+ y: win.visualViewport.offsetTop
1006
+ };
1007
+ }
1008
+ function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
1009
+ if (isFixed === void 0) {
1010
+ isFixed = false;
1011
+ }
1012
+ if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
1013
+ return false;
1014
+ }
1015
+ return isFixed;
1016
+ }
1017
+
1018
+ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
1019
+ if (includeScale === void 0) {
1020
+ includeScale = false;
1021
+ }
1022
+ if (isFixedStrategy === void 0) {
1023
+ isFixedStrategy = false;
1024
+ }
1025
+ const clientRect = element.getBoundingClientRect();
1026
+ const domElement = unwrapElement(element);
1027
+ let scale = createCoords(1);
1028
+ if (includeScale) {
1029
+ if (offsetParent) {
1030
+ if (isElement(offsetParent)) {
1031
+ scale = getScale(offsetParent);
1032
+ }
1033
+ } else {
1034
+ scale = getScale(element);
1035
+ }
1036
+ }
1037
+ const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
1038
+ let x = (clientRect.left + visualOffsets.x) / scale.x;
1039
+ let y = (clientRect.top + visualOffsets.y) / scale.y;
1040
+ let width = clientRect.width / scale.x;
1041
+ let height = clientRect.height / scale.y;
1042
+ if (domElement) {
1043
+ const win = getWindow(domElement);
1044
+ const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
1045
+ let currentWin = win;
1046
+ let currentIFrame = getFrameElement(currentWin);
1047
+ while (currentIFrame && offsetParent && offsetWin !== currentWin) {
1048
+ const iframeScale = getScale(currentIFrame);
1049
+ const iframeRect = currentIFrame.getBoundingClientRect();
1050
+ const css = getComputedStyle(currentIFrame);
1051
+ const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
1052
+ const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
1053
+ x *= iframeScale.x;
1054
+ y *= iframeScale.y;
1055
+ width *= iframeScale.x;
1056
+ height *= iframeScale.y;
1057
+ x += left;
1058
+ y += top;
1059
+ currentWin = getWindow(currentIFrame);
1060
+ currentIFrame = getFrameElement(currentWin);
1061
+ }
1062
+ }
1063
+ return rectToClientRect({
1064
+ width,
1065
+ height,
1066
+ x,
1067
+ y
1068
+ });
1069
+ }
1070
+
1071
+ // If <html> has a CSS width greater than the viewport, then this will be
1072
+ // incorrect for RTL.
1073
+ function getWindowScrollBarX(element, rect) {
1074
+ const leftScroll = getNodeScroll(element).scrollLeft;
1075
+ if (!rect) {
1076
+ return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;
1077
+ }
1078
+ return rect.left + leftScroll;
1079
+ }
1080
+
1081
+ function getHTMLOffset(documentElement, scroll, ignoreScrollbarX) {
1082
+ if (ignoreScrollbarX === void 0) {
1083
+ ignoreScrollbarX = false;
1084
+ }
1085
+ const htmlRect = documentElement.getBoundingClientRect();
1086
+ const x = htmlRect.left + scroll.scrollLeft - (ignoreScrollbarX ? 0 :
1087
+ // RTL <body> scrollbar.
1088
+ getWindowScrollBarX(documentElement, htmlRect));
1089
+ const y = htmlRect.top + scroll.scrollTop;
1090
+ return {
1091
+ x,
1092
+ y
1093
+ };
1094
+ }
1095
+
1096
+ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
1097
+ let {
1098
+ elements,
1099
+ rect,
1100
+ offsetParent,
1101
+ strategy
1102
+ } = _ref;
1103
+ const isFixed = strategy === 'fixed';
1104
+ const documentElement = getDocumentElement(offsetParent);
1105
+ const topLayer = elements ? isTopLayer(elements.floating) : false;
1106
+ if (offsetParent === documentElement || topLayer && isFixed) {
1107
+ return rect;
1108
+ }
1109
+ let scroll = {
1110
+ scrollLeft: 0,
1111
+ scrollTop: 0
1112
+ };
1113
+ let scale = createCoords(1);
1114
+ const offsets = createCoords(0);
1115
+ const isOffsetParentAnElement = isHTMLElement(offsetParent);
1116
+ if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
1117
+ if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
1118
+ scroll = getNodeScroll(offsetParent);
1119
+ }
1120
+ if (isHTMLElement(offsetParent)) {
1121
+ const offsetRect = getBoundingClientRect(offsetParent);
1122
+ scale = getScale(offsetParent);
1123
+ offsets.x = offsetRect.x + offsetParent.clientLeft;
1124
+ offsets.y = offsetRect.y + offsetParent.clientTop;
1125
+ }
1126
+ }
1127
+ const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll, true) : createCoords(0);
1128
+ return {
1129
+ width: rect.width * scale.x,
1130
+ height: rect.height * scale.y,
1131
+ x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,
1132
+ y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y
1133
+ };
1134
+ }
1135
+
1136
+ function getClientRects(element) {
1137
+ return Array.from(element.getClientRects());
1138
+ }
1139
+
1140
+ // Gets the entire size of the scrollable document area, even extending outside
1141
+ // of the `<html>` and `<body>` rect bounds if horizontally scrollable.
1142
+ function getDocumentRect(element) {
1143
+ const html = getDocumentElement(element);
1144
+ const scroll = getNodeScroll(element);
1145
+ const body = element.ownerDocument.body;
1146
+ const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
1147
+ const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
1148
+ let x = -scroll.scrollLeft + getWindowScrollBarX(element);
1149
+ const y = -scroll.scrollTop;
1150
+ if (getComputedStyle(body).direction === 'rtl') {
1151
+ x += max(html.clientWidth, body.clientWidth) - width;
1152
+ }
1153
+ return {
1154
+ width,
1155
+ height,
1156
+ x,
1157
+ y
1158
+ };
1159
+ }
1160
+
1161
+ function getViewportRect(element, strategy) {
1162
+ const win = getWindow(element);
1163
+ const html = getDocumentElement(element);
1164
+ const visualViewport = win.visualViewport;
1165
+ let width = html.clientWidth;
1166
+ let height = html.clientHeight;
1167
+ let x = 0;
1168
+ let y = 0;
1169
+ if (visualViewport) {
1170
+ width = visualViewport.width;
1171
+ height = visualViewport.height;
1172
+ const visualViewportBased = isWebKit();
1173
+ if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {
1174
+ x = visualViewport.offsetLeft;
1175
+ y = visualViewport.offsetTop;
1176
+ }
1177
+ }
1178
+ return {
1179
+ width,
1180
+ height,
1181
+ x,
1182
+ y
1183
+ };
1184
+ }
1185
+
1186
+ // Returns the inner client rect, subtracting scrollbars if present.
1187
+ function getInnerBoundingClientRect(element, strategy) {
1188
+ const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');
1189
+ const top = clientRect.top + element.clientTop;
1190
+ const left = clientRect.left + element.clientLeft;
1191
+ const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
1192
+ const width = element.clientWidth * scale.x;
1193
+ const height = element.clientHeight * scale.y;
1194
+ const x = left * scale.x;
1195
+ const y = top * scale.y;
1196
+ return {
1197
+ width,
1198
+ height,
1199
+ x,
1200
+ y
1201
+ };
1202
+ }
1203
+ function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
1204
+ let rect;
1205
+ if (clippingAncestor === 'viewport') {
1206
+ rect = getViewportRect(element, strategy);
1207
+ } else if (clippingAncestor === 'document') {
1208
+ rect = getDocumentRect(getDocumentElement(element));
1209
+ } else if (isElement(clippingAncestor)) {
1210
+ rect = getInnerBoundingClientRect(clippingAncestor, strategy);
1211
+ } else {
1212
+ const visualOffsets = getVisualOffsets(element);
1213
+ rect = {
1214
+ x: clippingAncestor.x - visualOffsets.x,
1215
+ y: clippingAncestor.y - visualOffsets.y,
1216
+ width: clippingAncestor.width,
1217
+ height: clippingAncestor.height
1218
+ };
1219
+ }
1220
+ return rectToClientRect(rect);
1221
+ }
1222
+ function hasFixedPositionAncestor(element, stopNode) {
1223
+ const parentNode = getParentNode(element);
1224
+ if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
1225
+ return false;
1226
+ }
1227
+ return getComputedStyle(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
1228
+ }
1229
+
1230
+ // A "clipping ancestor" is an `overflow` element with the characteristic of
1231
+ // clipping (or hiding) child elements. This returns all clipping ancestors
1232
+ // of the given element up the tree.
1233
+ function getClippingElementAncestors(element, cache) {
1234
+ const cachedResult = cache.get(element);
1235
+ if (cachedResult) {
1236
+ return cachedResult;
1237
+ }
1238
+ let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');
1239
+ let currentContainingBlockComputedStyle = null;
1240
+ const elementIsFixed = getComputedStyle(element).position === 'fixed';
1241
+ let currentNode = elementIsFixed ? getParentNode(element) : element;
1242
+
1243
+ // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
1244
+ while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
1245
+ const computedStyle = getComputedStyle(currentNode);
1246
+ const currentNodeIsContaining = isContainingBlock(currentNode);
1247
+ if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
1248
+ currentContainingBlockComputedStyle = null;
1249
+ }
1250
+ const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
1251
+ if (shouldDropCurrentNode) {
1252
+ // Drop non-containing blocks.
1253
+ result = result.filter(ancestor => ancestor !== currentNode);
1254
+ } else {
1255
+ // Record last containing block for next iteration.
1256
+ currentContainingBlockComputedStyle = computedStyle;
1257
+ }
1258
+ currentNode = getParentNode(currentNode);
1259
+ }
1260
+ cache.set(element, result);
1261
+ return result;
1262
+ }
1263
+
1264
+ // Gets the maximum area that the element is visible in due to any number of
1265
+ // clipping ancestors.
1266
+ function getClippingRect(_ref) {
1267
+ let {
1268
+ element,
1269
+ boundary,
1270
+ rootBoundary,
1271
+ strategy
1272
+ } = _ref;
1273
+ const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
1274
+ const clippingAncestors = [...elementClippingAncestors, rootBoundary];
1275
+ const firstClippingAncestor = clippingAncestors[0];
1276
+ const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
1277
+ const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
1278
+ accRect.top = max(rect.top, accRect.top);
1279
+ accRect.right = min(rect.right, accRect.right);
1280
+ accRect.bottom = min(rect.bottom, accRect.bottom);
1281
+ accRect.left = max(rect.left, accRect.left);
1282
+ return accRect;
1283
+ }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
1284
+ return {
1285
+ width: clippingRect.right - clippingRect.left,
1286
+ height: clippingRect.bottom - clippingRect.top,
1287
+ x: clippingRect.left,
1288
+ y: clippingRect.top
1289
+ };
1290
+ }
1291
+
1292
+ function getDimensions(element) {
1293
+ const {
1294
+ width,
1295
+ height
1296
+ } = getCssDimensions(element);
1297
+ return {
1298
+ width,
1299
+ height
1300
+ };
1301
+ }
1302
+
1303
+ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
1304
+ const isOffsetParentAnElement = isHTMLElement(offsetParent);
1305
+ const documentElement = getDocumentElement(offsetParent);
1306
+ const isFixed = strategy === 'fixed';
1307
+ const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
1308
+ let scroll = {
1309
+ scrollLeft: 0,
1310
+ scrollTop: 0
1311
+ };
1312
+ const offsets = createCoords(0);
1313
+ if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
1314
+ if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
1315
+ scroll = getNodeScroll(offsetParent);
1316
+ }
1317
+ if (isOffsetParentAnElement) {
1318
+ const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
1319
+ offsets.x = offsetRect.x + offsetParent.clientLeft;
1320
+ offsets.y = offsetRect.y + offsetParent.clientTop;
1321
+ } else if (documentElement) {
1322
+ // If the <body> scrollbar appears on the left (e.g. RTL systems). Use
1323
+ // Firefox with layout.scrollbar.side = 3 in about:config to test this.
1324
+ offsets.x = getWindowScrollBarX(documentElement);
1325
+ }
1326
+ }
1327
+ const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
1328
+ const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
1329
+ const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
1330
+ return {
1331
+ x,
1332
+ y,
1333
+ width: rect.width,
1334
+ height: rect.height
1335
+ };
1336
+ }
1337
+
1338
+ function isStaticPositioned(element) {
1339
+ return getComputedStyle(element).position === 'static';
1340
+ }
1341
+
1342
+ function getTrueOffsetParent(element, polyfill) {
1343
+ if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') {
1344
+ return null;
1345
+ }
1346
+ if (polyfill) {
1347
+ return polyfill(element);
1348
+ }
1349
+ let rawOffsetParent = element.offsetParent;
1350
+
1351
+ // Firefox returns the <html> element as the offsetParent if it's non-static,
1352
+ // while Chrome and Safari return the <body> element. The <body> element must
1353
+ // be used to perform the correct calculations even if the <html> element is
1354
+ // non-static.
1355
+ if (getDocumentElement(element) === rawOffsetParent) {
1356
+ rawOffsetParent = rawOffsetParent.ownerDocument.body;
1357
+ }
1358
+ return rawOffsetParent;
1359
+ }
1360
+
1361
+ // Gets the closest ancestor positioned element. Handles some edge cases,
1362
+ // such as table ancestors and cross browser bugs.
1363
+ function getOffsetParent(element, polyfill) {
1364
+ const win = getWindow(element);
1365
+ if (isTopLayer(element)) {
1366
+ return win;
1367
+ }
1368
+ if (!isHTMLElement(element)) {
1369
+ let svgOffsetParent = getParentNode(element);
1370
+ while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
1371
+ if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
1372
+ return svgOffsetParent;
1373
+ }
1374
+ svgOffsetParent = getParentNode(svgOffsetParent);
1375
+ }
1376
+ return win;
1377
+ }
1378
+ let offsetParent = getTrueOffsetParent(element, polyfill);
1379
+ while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {
1380
+ offsetParent = getTrueOffsetParent(offsetParent, polyfill);
1381
+ }
1382
+ if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {
1383
+ return win;
1384
+ }
1385
+ return offsetParent || getContainingBlock(element) || win;
1386
+ }
1387
+
1388
+ const getElementRects = async function (data) {
1389
+ const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
1390
+ const getDimensionsFn = this.getDimensions;
1391
+ const floatingDimensions = await getDimensionsFn(data.floating);
1392
+ return {
1393
+ reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
1394
+ floating: {
1395
+ x: 0,
1396
+ y: 0,
1397
+ width: floatingDimensions.width,
1398
+ height: floatingDimensions.height
1399
+ }
1400
+ };
1401
+ };
1402
+
1403
+ function isRTL(element) {
1404
+ return getComputedStyle(element).direction === 'rtl';
1405
+ }
1406
+
1407
+ const platform = {
1408
+ convertOffsetParentRelativeRectToViewportRelativeRect,
1409
+ getDocumentElement,
1410
+ getClippingRect,
1411
+ getOffsetParent,
1412
+ getElementRects,
1413
+ getClientRects,
1414
+ getDimensions,
1415
+ getScale,
1416
+ isElement,
1417
+ isRTL
1418
+ };
1419
+
1420
+ function rectsAreEqual(a, b) {
1421
+ return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
1422
+ }
1423
+
1424
+ // https://samthor.au/2021/observing-dom/
1425
+ function observeMove(element, onMove) {
1426
+ let io = null;
1427
+ let timeoutId;
1428
+ const root = getDocumentElement(element);
1429
+ function cleanup() {
1430
+ var _io;
1431
+ clearTimeout(timeoutId);
1432
+ (_io = io) == null || _io.disconnect();
1433
+ io = null;
1434
+ }
1435
+ function refresh(skip, threshold) {
1436
+ if (skip === void 0) {
1437
+ skip = false;
1438
+ }
1439
+ if (threshold === void 0) {
1440
+ threshold = 1;
1441
+ }
1442
+ cleanup();
1443
+ const elementRectForRootMargin = element.getBoundingClientRect();
1444
+ const {
1445
+ left,
1446
+ top,
1447
+ width,
1448
+ height
1449
+ } = elementRectForRootMargin;
1450
+ if (!skip) {
1451
+ onMove();
1452
+ }
1453
+ if (!width || !height) {
1454
+ return;
1455
+ }
1456
+ const insetTop = floor(top);
1457
+ const insetRight = floor(root.clientWidth - (left + width));
1458
+ const insetBottom = floor(root.clientHeight - (top + height));
1459
+ const insetLeft = floor(left);
1460
+ const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
1461
+ const options = {
1462
+ rootMargin,
1463
+ threshold: max(0, min(1, threshold)) || 1
1464
+ };
1465
+ let isFirstUpdate = true;
1466
+ function handleObserve(entries) {
1467
+ const ratio = entries[0].intersectionRatio;
1468
+ if (ratio !== threshold) {
1469
+ if (!isFirstUpdate) {
1470
+ return refresh();
1471
+ }
1472
+ if (!ratio) {
1473
+ // If the reference is clipped, the ratio is 0. Throttle the refresh
1474
+ // to prevent an infinite loop of updates.
1475
+ timeoutId = setTimeout(() => {
1476
+ refresh(false, 1e-7);
1477
+ }, 1000);
1478
+ } else {
1479
+ refresh(false, ratio);
1480
+ }
1481
+ }
1482
+ if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
1483
+ // It's possible that even though the ratio is reported as 1, the
1484
+ // element is not actually fully within the IntersectionObserver's root
1485
+ // area anymore. This can happen under performance constraints. This may
1486
+ // be a bug in the browser's IntersectionObserver implementation. To
1487
+ // work around this, we compare the element's bounding rect now with
1488
+ // what it was at the time we created the IntersectionObserver. If they
1489
+ // are not equal then the element moved, so we refresh.
1490
+ refresh();
1491
+ }
1492
+ isFirstUpdate = false;
1493
+ }
1494
+
1495
+ // Older browsers don't support a `document` as the root and will throw an
1496
+ // error.
1497
+ try {
1498
+ io = new IntersectionObserver(handleObserve, {
1499
+ ...options,
1500
+ // Handle <iframe>s
1501
+ root: root.ownerDocument
1502
+ });
1503
+ } catch (e) {
1504
+ io = new IntersectionObserver(handleObserve, options);
1505
+ }
1506
+ io.observe(element);
1507
+ }
1508
+ refresh(true);
1509
+ return cleanup;
1510
+ }
1511
+
1512
+ /**
1513
+ * Automatically updates the position of the floating element when necessary.
1514
+ * Should only be called when the floating element is mounted on the DOM or
1515
+ * visible on the screen.
1516
+ * @returns cleanup function that should be invoked when the floating element is
1517
+ * removed from the DOM or hidden from the screen.
1518
+ * @see https://floating-ui.com/docs/autoUpdate
1519
+ */
1520
+ function autoUpdate(reference, floating, update, options) {
1521
+ if (options === void 0) {
1522
+ options = {};
1523
+ }
1524
+ const {
1525
+ ancestorScroll = true,
1526
+ ancestorResize = true,
1527
+ elementResize = typeof ResizeObserver === 'function',
1528
+ layoutShift = typeof IntersectionObserver === 'function',
1529
+ animationFrame = false
1530
+ } = options;
1531
+ const referenceEl = unwrapElement(reference);
1532
+ const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...getOverflowAncestors(floating)] : [];
1533
+ ancestors.forEach(ancestor => {
1534
+ ancestorScroll && ancestor.addEventListener('scroll', update, {
1535
+ passive: true
1536
+ });
1537
+ ancestorResize && ancestor.addEventListener('resize', update);
1538
+ });
1539
+ const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
1540
+ let reobserveFrame = -1;
1541
+ let resizeObserver = null;
1542
+ if (elementResize) {
1543
+ resizeObserver = new ResizeObserver(_ref => {
1544
+ let [firstEntry] = _ref;
1545
+ if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
1546
+ // Prevent update loops when using the `size` middleware.
1547
+ // https://github.com/floating-ui/floating-ui/issues/1740
1548
+ resizeObserver.unobserve(floating);
1549
+ cancelAnimationFrame(reobserveFrame);
1550
+ reobserveFrame = requestAnimationFrame(() => {
1551
+ var _resizeObserver;
1552
+ (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);
1553
+ });
1554
+ }
1555
+ update();
1556
+ });
1557
+ if (referenceEl && !animationFrame) {
1558
+ resizeObserver.observe(referenceEl);
1559
+ }
1560
+ resizeObserver.observe(floating);
1561
+ }
1562
+ let frameId;
1563
+ let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
1564
+ if (animationFrame) {
1565
+ frameLoop();
1566
+ }
1567
+ function frameLoop() {
1568
+ const nextRefRect = getBoundingClientRect(reference);
1569
+ if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {
1570
+ update();
1571
+ }
1572
+ prevRefRect = nextRefRect;
1573
+ frameId = requestAnimationFrame(frameLoop);
1574
+ }
1575
+ update();
1576
+ return () => {
1577
+ var _resizeObserver2;
1578
+ ancestors.forEach(ancestor => {
1579
+ ancestorScroll && ancestor.removeEventListener('scroll', update);
1580
+ ancestorResize && ancestor.removeEventListener('resize', update);
1581
+ });
1582
+ cleanupIo == null || cleanupIo();
1583
+ (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();
1584
+ resizeObserver = null;
1585
+ if (animationFrame) {
1586
+ cancelAnimationFrame(frameId);
1587
+ }
1588
+ };
1589
+ }
1590
+
1591
+ /**
1592
+ * Modifies the placement by translating the floating element along the
1593
+ * specified axes.
1594
+ * A number (shorthand for `mainAxis` or distance), or an axes configuration
1595
+ * object may be passed.
1596
+ * @see https://floating-ui.com/docs/offset
1597
+ */
1598
+ const offset = offset$1;
1599
+
1600
+ /**
1601
+ * Optimizes the visibility of the floating element by shifting it in order to
1602
+ * keep it in view when it will overflow the clipping boundary.
1603
+ * @see https://floating-ui.com/docs/shift
1604
+ */
1605
+ const shift = shift$1;
1606
+
1607
+ /**
1608
+ * Optimizes the visibility of the floating element by flipping the `placement`
1609
+ * in order to keep it in view when the preferred placement(s) will overflow the
1610
+ * clipping boundary. Alternative to `autoPlacement`.
1611
+ * @see https://floating-ui.com/docs/flip
1612
+ */
1613
+ const flip = flip$1;
1614
+
1615
+ /**
1616
+ * Provides data to hide the floating element in applicable situations, such as
1617
+ * when it is not in the same clipping context as the reference element.
1618
+ * @see https://floating-ui.com/docs/hide
1619
+ */
1620
+ const hide = hide$1;
1621
+
1622
+ /**
1623
+ * Provides data to position an inner element of the floating element so that it
1624
+ * appears centered to the reference element.
1625
+ * @see https://floating-ui.com/docs/arrow
1626
+ */
1627
+ const arrow = arrow$1;
1628
+
1629
+ /**
1630
+ * Computes the `x` and `y` coordinates that will place the floating element
1631
+ * next to a given reference element.
1632
+ */
1633
+ const computePosition = (reference, floating, options) => {
1634
+ // This caches the expensive `getClippingElementAncestors` function so that
1635
+ // multiple lifecycle resets re-use the same result. It only lives for a
1636
+ // single call. If other functions become expensive, we can add them as well.
1637
+ const cache = new Map();
1638
+ const mergedOptions = {
1639
+ platform,
1640
+ ...options
1641
+ };
1642
+ const platformWithCache = {
1643
+ ...mergedOptions.platform,
1644
+ _c: cache
1645
+ };
1646
+ return computePosition$1(reference, floating, {
1647
+ ...mergedOptions,
1648
+ platform: platformWithCache
1649
+ });
1650
+ };
1651
+
1652
+ const onboardingTipCss = "*,*::after,*::before{box-sizing:border-box}.sr-only{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}::slotted([slot=heading]){display:flex !important;align-items:center !important;margin-block-end:0 !important;margin-block-start:0 !important;color:#fff !important;line-height:1.375 !important}:host{--_dso-button-primary-background-color:#fff;--_dso-button-primary-border-color:#fff;--_dso-button-primary-color:#000;--_dso-button-primary-hover-background-color:#ccc;--_dso-button-primary-hover-border-color:#ccc;--_dso-button-primary-hover-color:#000;--_dso-button-primary-active-background-color:#999;--_dso-button-primary-active-border-color:#999;--_dso-button-primary-active-color:#000;--_dso-button-primary-disabled-background-color:#fff;--_dso-button-primary-disabled-border-color:#fff;--_dso-button-primary-disabled-color:#b2b2b2;--_dso-button-secondary-background-color:#fff;--_dso-button-secondary-border-color:#fff;--_dso-button-secondary-color:#000;--_dso-button-secondary-hover-background-color:#ccc;--_dso-button-secondary-hover-border-color:#ccc;--_dso-button-secondary-hover-color:#000;--_dso-button-secondary-active-background-color:#999;--_dso-button-secondary-active-border-color:#999;--_dso-button-secondary-active-color:#000;--_dso-button-secondary-disabled-background-color:#fff;--_dso-button-secondary-disabled-border-color:#fff;--_dso-button-secondary-disabled-color:#b2b2b2;display:block;filter:drop-shadow(2px 2px 16px rgba(0, 0, 0, 0.4))}:host([popover]){margin:0 !important;border:0;padding:0;background-color:transparent;overflow:unset}.onboarding-tip{font-family:Asap, sans-serif;font-style:normal;font-weight:400;line-height:1.5;line-break:auto;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:break-word;word-spacing:normal;word-wrap:normal;white-space:normal;font-size:14px;inset-block-start:0;inset-inline-start:0;z-index:410}@media screen and (max-width: 360px){.onboarding-tip{padding-inline-start:8px !important}}.dso-close{-webkit-appearance:button;color:inherit;cursor:pointer;font:inherit;font-family:inherit;font-size:inherit;line-height:inherit;margin:0;overflow:visible;text-transform:none;position:absolute;inset-block-start:0;inset-inline-end:0;block-size:32px;inline-size:32px;padding:0;background-color:transparent;border:0;text-align:center}.dso-close[disabled]{cursor:default}.dso-close::-moz-focus-inner{border:0;padding:0}.onboarding-tip-inner{--link-color:#fff;--link-hover-color:#b2b2b2;--link-visited-color:#7f7f7f;max-inline-size:min(360px, 100vw - 2 * 8px);max-block-size:40vh;overflow:auto;padding-block:32px 8px;padding-inline:8px;border-radius:4px;display:block;font-size:1rem;position:relative;z-index:2}.onboarding-tip-inner{background-color:#2b5780;border-color:#2b5780;color:#fff}.onboarding-tip-arrow{border-start-start-radius:4px;position:absolute;block-size:20px;inline-size:20px;background:#2b5780;z-index:1;pointer-events:none}.onboarding-tip-content-wrapper{padding-inline:16px;padding-block-end:16px}.onboarding-tip-content-heading{display:flex}.onboarding-tip-content-heading dso-icon{margin-inline-end:8px}";
1653
+
1654
+ const OnboardingTip = class {
1655
+ constructor(hostRef) {
1656
+ index.registerInstance(this, hostRef);
1657
+ this.dsoClose = index.createEvent(this, "dsoClose", 7);
1658
+ /**
1659
+ * Where to place the Onboarding Tip relative to its reference element.
1660
+ */
1661
+ this.placement = "right";
1662
+ }
1663
+ componentDidRender() {
1664
+ if (!this.host.matches(":popover-open")) {
1665
+ this.host.showPopover();
1666
+ }
1667
+ if (!this.cleanUp && this.referenceElement && this.tipArrowRef instanceof HTMLElement) {
1668
+ this.cleanUp = OnboardingTip.positionTip(this.referenceElement, this.host, this.tipArrowRef, this.placement);
1669
+ }
1670
+ }
1671
+ disconnectedCallback() {
1672
+ var _a;
1673
+ if (this.host.matches(":popover-open")) {
1674
+ this.host.hidePopover();
1675
+ }
1676
+ (_a = this.cleanUp) === null || _a === void 0 ? void 0 : _a.call(this);
1677
+ this.cleanUp = undefined;
1678
+ }
1679
+ /**
1680
+ * This function positions the Onboarding Tip relative to its reference element. It is static so the position is calculated
1681
+ * only using the passed arguments.
1682
+ */
1683
+ static positionTip(referenceElement, tipRef, tipArrowRef, placement) {
1684
+ // Get half the arrow box's hypotenuse length
1685
+ const arrowLength = tipArrowRef.offsetWidth;
1686
+ const floatingOffset = Math.sqrt(2 * arrowLength ** 2) / 2;
1687
+ const padding = 5;
1688
+ return autoUpdate(referenceElement, tipRef, () => {
1689
+ computePosition(referenceElement, tipRef, {
1690
+ strategy: "fixed",
1691
+ middleware: [
1692
+ offset(floatingOffset),
1693
+ flip({
1694
+ padding,
1695
+ }),
1696
+ shift({
1697
+ padding,
1698
+ }),
1699
+ arrow({
1700
+ padding: padding + arrowLength,
1701
+ element: tipArrowRef,
1702
+ }),
1703
+ hide({
1704
+ padding: 42,
1705
+ }),
1706
+ ],
1707
+ placement,
1708
+ }).then(({ x, y, middlewareData, placement: computedPlacement }) => {
1709
+ if (middlewareData.hide) {
1710
+ Object.assign(tipRef.style, {
1711
+ visibility: middlewareData.hide.referenceHidden ? "hidden" : "visible",
1712
+ });
1713
+ }
1714
+ Object.assign(tipRef.style, {
1715
+ left: `${x}px`,
1716
+ top: `${y}px`,
1717
+ });
1718
+ const side = computedPlacement.split("-")[0];
1719
+ const staticSide = side
1720
+ ? {
1721
+ top: "bottom",
1722
+ right: "left",
1723
+ bottom: "top",
1724
+ left: "right",
1725
+ }[side]
1726
+ : "top";
1727
+ let angle;
1728
+ switch (staticSide) {
1729
+ default:
1730
+ case "top":
1731
+ angle = 45;
1732
+ break;
1733
+ case "right":
1734
+ angle = 135;
1735
+ break;
1736
+ case "bottom":
1737
+ angle = 225;
1738
+ break;
1739
+ case "left":
1740
+ angle = 315;
1741
+ break;
1742
+ }
1743
+ if (middlewareData.arrow && staticSide) {
1744
+ const { x: arrowX, y: arrowY } = middlewareData.arrow;
1745
+ Object.assign(tipArrowRef.style, {
1746
+ right: "",
1747
+ bottom: "",
1748
+ left: arrowX ? `${arrowX}px` : "",
1749
+ top: arrowY ? `${arrowY}px` : "",
1750
+ [staticSide]: `${-arrowLength / 2}px`,
1751
+ transform: `rotate(${angle}deg)`,
1752
+ });
1753
+ }
1754
+ });
1755
+ });
1756
+ }
1757
+ render() {
1758
+ return (index.h(index.Host, { key: '81f55bb9189b1e006db917d0563d67701710f519', popover: "manual" }, index.h("div", { key: 'eed3544de4a3a2b592c4ae418a582e87b2ee0133', class: "onboarding-tip", role: "tooltip" }, index.h("div", { key: '5847872cf4e5b918c525d62a3d592a765a8e8154', class: "onboarding-tip-inner" }, index.h("div", { key: 'c35d3a3fe5e926dde418019e1b8b209e6223d504', class: "onboarding-tip-content-wrapper" }, this.headingSlottedElement !== null && (index.h("div", { key: '1911891c6aff456fc4e43f80b687f87d1ba1df9d', class: "onboarding-tip-content-heading" }, index.h("dso-icon", { key: '3050474a5736b09709e114f1397b8160cb5b9868', icon: "light-bulb" }), index.h("slot", { key: '86c668f6602ba615db80c4338edc1157cdaa9999', name: "heading" }))), index.h("button", { key: '65d9ec9d3e84a409fa18ebd4d6343377a6e25126', type: "button", class: "dso-close", onClick: (e) => this.dsoClose.emit({ originalEvent: e }) }, index.h("dso-icon", { key: 'ec8eb3a63525d2736debd7986ce5546619315553', icon: "times" }), index.h("span", { key: '99e9048e8003e211488c7fdd2eeda4a32c740b3a', class: "sr-only" }, "Sluiten")), index.h("slot", { key: '886ba7c055fc303d0186dec7ca30c90d2c6c2943' }))), index.h("div", { key: 'e838baea223b335370a4d0f14f300fa6d48853a7', class: "onboarding-tip-arrow", ref: (ref) => (this.tipArrowRef = ref) }))));
1759
+ }
1760
+ get headingSlottedElement() {
1761
+ return this.host.querySelector("[slot='heading']");
1762
+ }
1763
+ get referenceElement() {
1764
+ const id = this.host.id;
1765
+ if (!id) {
1766
+ console.warn("Unable to find reference. Onboarding Tip has no [id] attribute.");
1767
+ return;
1768
+ }
1769
+ const rootNode = this.host.getRootNode();
1770
+ if (!(rootNode instanceof Document || rootNode instanceof ShadowRoot)) {
1771
+ console.warn(`rootNode is not instance of Document or ShadowRoot`);
1772
+ return;
1773
+ }
1774
+ const reference = rootNode.querySelector(`[aria-describedby="${id}`);
1775
+ if (!reference) {
1776
+ console.warn(`Unable to find reference element with aria-describedby ${id}`);
1777
+ return;
1778
+ }
1779
+ return reference;
1780
+ }
1781
+ get host() { return index.getElement(this); }
1782
+ };
1783
+ OnboardingTip.style = onboardingTipCss;
1784
+
1785
+ exports.dso_onboarding_tip = OnboardingTip;
1786
+ //# sourceMappingURL=dso-onboarding-tip.entry.cjs.js.map
1787
+
1788
+ //# sourceMappingURL=dso-onboarding-tip.cjs.entry.js.map