@folkehelseinstituttet/designsystem 0.40.0 → 0.40.2

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 (271) hide show
  1. package/decorate-DFXIek-k.js +611 -0
  2. package/decorate-DFXIek-k.js.map +1 -0
  3. package/fhi-body.js +23 -32
  4. package/fhi-body.js.map +1 -1
  5. package/fhi-button.js +90 -112
  6. package/fhi-button.js.map +1 -1
  7. package/fhi-checkbox.js +53 -66
  8. package/fhi-checkbox.js.map +1 -1
  9. package/fhi-data-table-cell.js +23 -29
  10. package/fhi-data-table-cell.js.map +1 -1
  11. package/fhi-data-table-row.js +40 -65
  12. package/fhi-data-table-row.js.map +1 -1
  13. package/fhi-data-table.js +30 -36
  14. package/fhi-data-table.js.map +1 -1
  15. package/fhi-date-input.component-Bus7CeKM.js +278 -0
  16. package/fhi-date-input.component-Bus7CeKM.js.map +1 -0
  17. package/fhi-date-input.js +2 -305
  18. package/fhi-display.js +29 -46
  19. package/fhi-display.js.map +1 -1
  20. package/fhi-flex.js +40 -50
  21. package/fhi-flex.js.map +1 -1
  22. package/fhi-grid.js +30 -46
  23. package/fhi-grid.js.map +1 -1
  24. package/fhi-headline.js +29 -46
  25. package/fhi-headline.js.map +1 -1
  26. package/fhi-icon-arrow-down-left.js +26 -43
  27. package/fhi-icon-arrow-down-left.js.map +1 -1
  28. package/fhi-icon-arrow-down-right.js +26 -43
  29. package/fhi-icon-arrow-down-right.js.map +1 -1
  30. package/fhi-icon-arrow-down.js +26 -43
  31. package/fhi-icon-arrow-down.js.map +1 -1
  32. package/fhi-icon-arrow-left.js +26 -43
  33. package/fhi-icon-arrow-left.js.map +1 -1
  34. package/fhi-icon-arrow-right-left.js +26 -43
  35. package/fhi-icon-arrow-right-left.js.map +1 -1
  36. package/fhi-icon-arrow-right.js +26 -43
  37. package/fhi-icon-arrow-right.js.map +1 -1
  38. package/fhi-icon-arrow-up-down.js +26 -43
  39. package/fhi-icon-arrow-up-down.js.map +1 -1
  40. package/fhi-icon-arrow-up-left.js +26 -43
  41. package/fhi-icon-arrow-up-left.js.map +1 -1
  42. package/fhi-icon-arrow-up-right.js +26 -43
  43. package/fhi-icon-arrow-up-right.js.map +1 -1
  44. package/fhi-icon-arrow-up.js +26 -43
  45. package/fhi-icon-arrow-up.js.map +1 -1
  46. package/fhi-icon-bell.js +26 -43
  47. package/fhi-icon-bell.js.map +1 -1
  48. package/fhi-icon-calendar-clock.js +26 -43
  49. package/fhi-icon-calendar-clock.js.map +1 -1
  50. package/fhi-icon-calendar.js +26 -43
  51. package/fhi-icon-calendar.js.map +1 -1
  52. package/fhi-icon-chart-bar-stacked.js +26 -43
  53. package/fhi-icon-chart-bar-stacked.js.map +1 -1
  54. package/fhi-icon-chart-bar.js +26 -43
  55. package/fhi-icon-chart-bar.js.map +1 -1
  56. package/fhi-icon-chart-column-stacked.js +26 -43
  57. package/fhi-icon-chart-column-stacked.js.map +1 -1
  58. package/fhi-icon-chart-column.js +26 -43
  59. package/fhi-icon-chart-column.js.map +1 -1
  60. package/fhi-icon-chart-line.js +26 -43
  61. package/fhi-icon-chart-line.js.map +1 -1
  62. package/fhi-icon-chart-no-axes-combined.js +26 -43
  63. package/fhi-icon-chart-no-axes-combined.js.map +1 -1
  64. package/fhi-icon-chart-pie.js +26 -43
  65. package/fhi-icon-chart-pie.js.map +1 -1
  66. package/fhi-icon-check.js +26 -43
  67. package/fhi-icon-check.js.map +1 -1
  68. package/fhi-icon-chevron-down.js +26 -43
  69. package/fhi-icon-chevron-down.js.map +1 -1
  70. package/fhi-icon-chevron-left.js +26 -43
  71. package/fhi-icon-chevron-left.js.map +1 -1
  72. package/fhi-icon-chevron-right.js +26 -43
  73. package/fhi-icon-chevron-right.js.map +1 -1
  74. package/fhi-icon-chevron-up.js +26 -43
  75. package/fhi-icon-chevron-up.js.map +1 -1
  76. package/fhi-icon-chevrons-down.js +26 -43
  77. package/fhi-icon-chevrons-down.js.map +1 -1
  78. package/fhi-icon-chevrons-left.js +26 -43
  79. package/fhi-icon-chevrons-left.js.map +1 -1
  80. package/fhi-icon-chevrons-right.js +26 -43
  81. package/fhi-icon-chevrons-right.js.map +1 -1
  82. package/fhi-icon-chevrons-up.js +26 -43
  83. package/fhi-icon-chevrons-up.js.map +1 -1
  84. package/fhi-icon-circle-arrow-down.js +26 -43
  85. package/fhi-icon-circle-arrow-down.js.map +1 -1
  86. package/fhi-icon-circle-arrow-left.js +26 -43
  87. package/fhi-icon-circle-arrow-left.js.map +1 -1
  88. package/fhi-icon-circle-arrow-right.js +26 -43
  89. package/fhi-icon-circle-arrow-right.js.map +1 -1
  90. package/fhi-icon-circle-arrow-up.js +26 -43
  91. package/fhi-icon-circle-arrow-up.js.map +1 -1
  92. package/fhi-icon-circle-check-big.js +26 -43
  93. package/fhi-icon-circle-check-big.js.map +1 -1
  94. package/fhi-icon-circle-check.js +26 -43
  95. package/fhi-icon-circle-check.js.map +1 -1
  96. package/fhi-icon-circle-chevron-down.js +26 -43
  97. package/fhi-icon-circle-chevron-down.js.map +1 -1
  98. package/fhi-icon-circle-chevron-left.js +26 -43
  99. package/fhi-icon-circle-chevron-left.js.map +1 -1
  100. package/fhi-icon-circle-chevron-right.js +26 -43
  101. package/fhi-icon-circle-chevron-right.js.map +1 -1
  102. package/fhi-icon-circle-chevron-up.js +26 -43
  103. package/fhi-icon-circle-chevron-up.js.map +1 -1
  104. package/fhi-icon-circle-exclamation.js +26 -43
  105. package/fhi-icon-circle-exclamation.js.map +1 -1
  106. package/fhi-icon-circle-info.js +26 -43
  107. package/fhi-icon-circle-info.js.map +1 -1
  108. package/fhi-icon-circle-minus.js +26 -43
  109. package/fhi-icon-circle-minus.js.map +1 -1
  110. package/fhi-icon-circle-plus.js +26 -43
  111. package/fhi-icon-circle-plus.js.map +1 -1
  112. package/fhi-icon-circle-question.js +26 -43
  113. package/fhi-icon-circle-question.js.map +1 -1
  114. package/fhi-icon-circle-x.js +26 -43
  115. package/fhi-icon-circle-x.js.map +1 -1
  116. package/fhi-icon-circle.js +26 -43
  117. package/fhi-icon-circle.js.map +1 -1
  118. package/fhi-icon-clock.js +26 -43
  119. package/fhi-icon-clock.js.map +1 -1
  120. package/fhi-icon-copy.js +26 -43
  121. package/fhi-icon-copy.js.map +1 -1
  122. package/fhi-icon-download.js +26 -43
  123. package/fhi-icon-download.js.map +1 -1
  124. package/fhi-icon-ellipsis-vertical.js +26 -43
  125. package/fhi-icon-ellipsis-vertical.js.map +1 -1
  126. package/fhi-icon-ellipsis.js +26 -43
  127. package/fhi-icon-ellipsis.js.map +1 -1
  128. package/fhi-icon-exclamation.js +26 -43
  129. package/fhi-icon-exclamation.js.map +1 -1
  130. package/fhi-icon-expand.js +26 -43
  131. package/fhi-icon-expand.js.map +1 -1
  132. package/fhi-icon-external-link.js +26 -43
  133. package/fhi-icon-external-link.js.map +1 -1
  134. package/fhi-icon-eye-off.js +26 -43
  135. package/fhi-icon-eye-off.js.map +1 -1
  136. package/fhi-icon-eye.js +26 -43
  137. package/fhi-icon-eye.js.map +1 -1
  138. package/fhi-icon-file-text.js +26 -43
  139. package/fhi-icon-file-text.js.map +1 -1
  140. package/fhi-icon-file.js +26 -43
  141. package/fhi-icon-file.js.map +1 -1
  142. package/fhi-icon-filter.js +26 -43
  143. package/fhi-icon-filter.js.map +1 -1
  144. package/fhi-icon-folder.js +26 -43
  145. package/fhi-icon-folder.js.map +1 -1
  146. package/fhi-icon-gear.js +26 -43
  147. package/fhi-icon-gear.js.map +1 -1
  148. package/fhi-icon-grid-9-dots.js +26 -43
  149. package/fhi-icon-grid-9-dots.js.map +1 -1
  150. package/fhi-icon-grip-horizontal.js +26 -43
  151. package/fhi-icon-grip-horizontal.js.map +1 -1
  152. package/fhi-icon-grip-vertical.js +26 -43
  153. package/fhi-icon-grip-vertical.js.map +1 -1
  154. package/fhi-icon-history.js +26 -43
  155. package/fhi-icon-history.js.map +1 -1
  156. package/fhi-icon-info.js +26 -43
  157. package/fhi-icon-info.js.map +1 -1
  158. package/fhi-icon-link-2-off.js +26 -43
  159. package/fhi-icon-link-2-off.js.map +1 -1
  160. package/fhi-icon-link-2.js +26 -43
  161. package/fhi-icon-link-2.js.map +1 -1
  162. package/fhi-icon-link.js +26 -43
  163. package/fhi-icon-link.js.map +1 -1
  164. package/fhi-icon-lock-open.js +26 -43
  165. package/fhi-icon-lock-open.js.map +1 -1
  166. package/fhi-icon-lock.js +26 -43
  167. package/fhi-icon-lock.js.map +1 -1
  168. package/fhi-icon-log-in.js +26 -43
  169. package/fhi-icon-log-in.js.map +1 -1
  170. package/fhi-icon-log-out.js +26 -43
  171. package/fhi-icon-log-out.js.map +1 -1
  172. package/fhi-icon-mail.js +26 -43
  173. package/fhi-icon-mail.js.map +1 -1
  174. package/fhi-icon-map-pin.js +26 -43
  175. package/fhi-icon-map-pin.js.map +1 -1
  176. package/fhi-icon-menu.js +26 -43
  177. package/fhi-icon-menu.js.map +1 -1
  178. package/fhi-icon-message.js +26 -43
  179. package/fhi-icon-message.js.map +1 -1
  180. package/fhi-icon-minus.js +26 -43
  181. package/fhi-icon-minus.js.map +1 -1
  182. package/fhi-icon-octagon-alert.js +26 -43
  183. package/fhi-icon-octagon-alert.js.map +1 -1
  184. package/fhi-icon-paperclip.js +26 -43
  185. package/fhi-icon-paperclip.js.map +1 -1
  186. package/fhi-icon-pencil.js +26 -43
  187. package/fhi-icon-pencil.js.map +1 -1
  188. package/fhi-icon-phone.js +26 -43
  189. package/fhi-icon-phone.js.map +1 -1
  190. package/fhi-icon-pin-off.js +26 -43
  191. package/fhi-icon-pin-off.js.map +1 -1
  192. package/fhi-icon-pin.js +26 -43
  193. package/fhi-icon-pin.js.map +1 -1
  194. package/fhi-icon-plus.js +26 -43
  195. package/fhi-icon-plus.js.map +1 -1
  196. package/fhi-icon-printer.js +26 -43
  197. package/fhi-icon-printer.js.map +1 -1
  198. package/fhi-icon-question.js +26 -43
  199. package/fhi-icon-question.js.map +1 -1
  200. package/fhi-icon-refresh.js +26 -43
  201. package/fhi-icon-refresh.js.map +1 -1
  202. package/fhi-icon-rotate-left.js +26 -43
  203. package/fhi-icon-rotate-left.js.map +1 -1
  204. package/fhi-icon-rotate-right.js +26 -43
  205. package/fhi-icon-rotate-right.js.map +1 -1
  206. package/fhi-icon-search.js +26 -43
  207. package/fhi-icon-search.js.map +1 -1
  208. package/fhi-icon-send.js +26 -43
  209. package/fhi-icon-send.js.map +1 -1
  210. package/fhi-icon-share.js +26 -43
  211. package/fhi-icon-share.js.map +1 -1
  212. package/fhi-icon-sheet.js +26 -43
  213. package/fhi-icon-sheet.js.map +1 -1
  214. package/fhi-icon-square-check-big.js +26 -43
  215. package/fhi-icon-square-check-big.js.map +1 -1
  216. package/fhi-icon-square-check.js +26 -43
  217. package/fhi-icon-square-check.js.map +1 -1
  218. package/fhi-icon-square-pen.js +26 -43
  219. package/fhi-icon-square-pen.js.map +1 -1
  220. package/fhi-icon-square-x.js +26 -43
  221. package/fhi-icon-square-x.js.map +1 -1
  222. package/fhi-icon-square.js +26 -43
  223. package/fhi-icon-square.js.map +1 -1
  224. package/fhi-icon-trash.js +26 -43
  225. package/fhi-icon-trash.js.map +1 -1
  226. package/fhi-icon-triangle-alert.js +26 -43
  227. package/fhi-icon-triangle-alert.js.map +1 -1
  228. package/fhi-icon-upload.js +26 -43
  229. package/fhi-icon-upload.js.map +1 -1
  230. package/fhi-icon-user.js +26 -43
  231. package/fhi-icon-user.js.map +1 -1
  232. package/fhi-icon-x.js +26 -43
  233. package/fhi-icon-x.js.map +1 -1
  234. package/fhi-label.js +23 -32
  235. package/fhi-label.js.map +1 -1
  236. package/fhi-modal-dialog.js +76 -111
  237. package/fhi-modal-dialog.js.map +1 -1
  238. package/fhi-radio.js +91 -109
  239. package/fhi-radio.js.map +1 -1
  240. package/fhi-tag.js +32 -44
  241. package/fhi-tag.js.map +1 -1
  242. package/fhi-text-input.js +96 -126
  243. package/fhi-text-input.js.map +1 -1
  244. package/fhi-title.js +29 -46
  245. package/fhi-title.js.map +1 -1
  246. package/fhi-tooltip.component-DJNDfrHK.js +919 -0
  247. package/fhi-tooltip.component-DJNDfrHK.js.map +1 -0
  248. package/fhi-tooltip.js +2 -1162
  249. package/fonts/RobotoFlex.ttf +0 -0
  250. package/if-defined-Dl-W5B5_.js +7 -0
  251. package/if-defined-Dl-W5B5_.js.map +1 -0
  252. package/index.js +123 -369
  253. package/package.json +1 -1
  254. package/theme/default.css +480 -1
  255. package/unsafe-html-CBTN3162.js +50 -0
  256. package/unsafe-html-CBTN3162.js.map +1 -0
  257. package/web-types.json +1 -1
  258. package/base-D76d76ww.js +0 -10
  259. package/base-D76d76ww.js.map +0 -1
  260. package/fhi-date-input.js.map +0 -1
  261. package/fhi-tooltip.js.map +0 -1
  262. package/fonts/RobotoFlex.ttf.js.map +0 -1
  263. package/if-defined-B_sR6Mtk.js +0 -11
  264. package/if-defined-B_sR6Mtk.js.map +0 -1
  265. package/index.js.map +0 -1
  266. package/property-B2Ico5CW.js +0 -605
  267. package/property-B2Ico5CW.js.map +0 -1
  268. package/query-Ddbd72Um.js +0 -21
  269. package/query-Ddbd72Um.js.map +0 -1
  270. package/unsafe-html-DfuTUjUu.js +0 -48
  271. package/unsafe-html-DfuTUjUu.js.map +0 -1
package/fhi-tooltip.js CHANGED
@@ -1,1162 +1,2 @@
1
- import { n as j, i as Ht, a as It, b as Xt, t as jt } from "./property-B2Ico5CW.js";
2
- import { e as Lt } from "./query-Ddbd72Um.js";
3
- /**
4
- * @license
5
- * Copyright 2017 Google LLC
6
- * SPDX-License-Identifier: BSD-3-Clause
7
- */
8
- function pt(t) {
9
- return j({ ...t, state: !0, attribute: !1 });
10
- }
11
- const Q = Math.min, W = Math.max, Z = Math.round, J = Math.floor, L = (t) => ({
12
- x: t,
13
- y: t
14
- }), Kt = {
15
- left: "right",
16
- right: "left",
17
- bottom: "top",
18
- top: "bottom"
19
- };
20
- function bt(t, e, n) {
21
- return W(t, Q(e, n));
22
- }
23
- function it(t, e) {
24
- return typeof t == "function" ? t(e) : t;
25
- }
26
- function N(t) {
27
- return t.split("-")[0];
28
- }
29
- function nt(t) {
30
- return t.split("-")[1];
31
- }
32
- function St(t) {
33
- return t === "x" ? "y" : "x";
34
- }
35
- function Pt(t) {
36
- return t === "y" ? "height" : "width";
37
- }
38
- function F(t) {
39
- const e = t[0];
40
- return e === "t" || e === "b" ? "y" : "x";
41
- }
42
- function kt(t) {
43
- return St(F(t));
44
- }
45
- function Yt(t, e, n) {
46
- n === void 0 && (n = !1);
47
- const i = nt(t), o = kt(t), r = Pt(o);
48
- let s = o === "x" ? i === (n ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
49
- return e.reference[r] > e.floating[r] && (s = tt(s)), [s, tt(s)];
50
- }
51
- function qt(t) {
52
- const e = tt(t);
53
- return [ht(t), e, ht(e)];
54
- }
55
- function ht(t) {
56
- return t.includes("start") ? t.replace("start", "end") : t.replace("end", "start");
57
- }
58
- const _t = ["left", "right"], Rt = ["right", "left"], Ut = ["top", "bottom"], Gt = ["bottom", "top"];
59
- function Jt(t, e, n) {
60
- switch (t) {
61
- case "top":
62
- case "bottom":
63
- return n ? e ? Rt : _t : e ? _t : Rt;
64
- case "left":
65
- case "right":
66
- return e ? Ut : Gt;
67
- default:
68
- return [];
69
- }
70
- }
71
- function Qt(t, e, n, i) {
72
- const o = nt(t);
73
- let r = Jt(N(t), n === "start", i);
74
- return o && (r = r.map((s) => s + "-" + o), e && (r = r.concat(r.map(ht)))), r;
75
- }
76
- function tt(t) {
77
- const e = N(t);
78
- return Kt[e] + t.slice(e.length);
79
- }
80
- function Zt(t) {
81
- return {
82
- top: 0,
83
- right: 0,
84
- bottom: 0,
85
- left: 0,
86
- ...t
87
- };
88
- }
89
- function te(t) {
90
- return typeof t != "number" ? Zt(t) : {
91
- top: t,
92
- right: t,
93
- bottom: t,
94
- left: t
95
- };
96
- }
97
- function et(t) {
98
- const {
99
- x: e,
100
- y: n,
101
- width: i,
102
- height: o
103
- } = t;
104
- return {
105
- width: i,
106
- height: o,
107
- top: n,
108
- left: e,
109
- right: e + i,
110
- bottom: n + o,
111
- x: e,
112
- y: n
113
- };
114
- }
115
- function Ot(t, e, n) {
116
- let {
117
- reference: i,
118
- floating: o
119
- } = t;
120
- const r = F(e), s = kt(e), c = Pt(s), l = N(e), a = r === "y", h = i.x + i.width / 2 - o.width / 2, u = i.y + i.height / 2 - o.height / 2, d = i[c] / 2 - o[c] / 2;
121
- let f;
122
- switch (l) {
123
- case "top":
124
- f = {
125
- x: h,
126
- y: i.y - o.height
127
- };
128
- break;
129
- case "bottom":
130
- f = {
131
- x: h,
132
- y: i.y + i.height
133
- };
134
- break;
135
- case "right":
136
- f = {
137
- x: i.x + i.width,
138
- y: u
139
- };
140
- break;
141
- case "left":
142
- f = {
143
- x: i.x - o.width,
144
- y: u
145
- };
146
- break;
147
- default:
148
- f = {
149
- x: i.x,
150
- y: i.y
151
- };
152
- }
153
- switch (nt(e)) {
154
- case "start":
155
- f[s] -= d * (n && a ? -1 : 1);
156
- break;
157
- case "end":
158
- f[s] += d * (n && a ? -1 : 1);
159
- break;
160
- }
161
- return f;
162
- }
163
- async function ee(t, e) {
164
- var n;
165
- e === void 0 && (e = {});
166
- const {
167
- x: i,
168
- y: o,
169
- platform: r,
170
- rects: s,
171
- elements: c,
172
- strategy: l
173
- } = t, {
174
- boundary: a = "clippingAncestors",
175
- rootBoundary: h = "viewport",
176
- elementContext: u = "floating",
177
- altBoundary: d = !1,
178
- padding: f = 0
179
- } = it(e, t), p = te(f), y = c[d ? u === "floating" ? "reference" : "floating" : u], g = et(await r.getClippingRect({
180
- element: (n = await (r.isElement == null ? void 0 : r.isElement(y))) == null || n ? y : y.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(c.floating)),
181
- boundary: a,
182
- rootBoundary: h,
183
- strategy: l
184
- })), w = u === "floating" ? {
185
- x: i,
186
- y: o,
187
- width: s.floating.width,
188
- height: s.floating.height
189
- } : s.reference, x = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(c.floating)), v = await (r.isElement == null ? void 0 : r.isElement(x)) ? await (r.getScale == null ? void 0 : r.getScale(x)) || {
190
- x: 1,
191
- y: 1
192
- } : {
193
- x: 1,
194
- y: 1
195
- }, O = et(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
196
- elements: c,
197
- rect: w,
198
- offsetParent: x,
199
- strategy: l
200
- }) : w);
201
- return {
202
- top: (g.top - O.top + p.top) / v.y,
203
- bottom: (O.bottom - g.bottom + p.bottom) / v.y,
204
- left: (g.left - O.left + p.left) / v.x,
205
- right: (O.right - g.right + p.right) / v.x
206
- };
207
- }
208
- const ie = 50, ne = async (t, e, n) => {
209
- const {
210
- placement: i = "bottom",
211
- strategy: o = "absolute",
212
- middleware: r = [],
213
- platform: s
214
- } = n, c = s.detectOverflow ? s : {
215
- ...s,
216
- detectOverflow: ee
217
- }, l = await (s.isRTL == null ? void 0 : s.isRTL(e));
218
- let a = await s.getElementRects({
219
- reference: t,
220
- floating: e,
221
- strategy: o
222
- }), {
223
- x: h,
224
- y: u
225
- } = Ot(a, i, l), d = i, f = 0;
226
- const p = {};
227
- for (let m = 0; m < r.length; m++) {
228
- const y = r[m];
229
- if (!y)
230
- continue;
231
- const {
232
- name: g,
233
- fn: w
234
- } = y, {
235
- x,
236
- y: v,
237
- data: O,
238
- reset: b
239
- } = await w({
240
- x: h,
241
- y: u,
242
- initialPlacement: i,
243
- placement: d,
244
- strategy: o,
245
- middlewareData: p,
246
- rects: a,
247
- platform: c,
248
- elements: {
249
- reference: t,
250
- floating: e
251
- }
252
- });
253
- h = x ?? h, u = v ?? u, p[g] = {
254
- ...p[g],
255
- ...O
256
- }, b && f < ie && (f++, typeof b == "object" && (b.placement && (d = b.placement), b.rects && (a = b.rects === !0 ? await s.getElementRects({
257
- reference: t,
258
- floating: e,
259
- strategy: o
260
- }) : b.rects), {
261
- x: h,
262
- y: u
263
- } = Ot(a, d, l)), m = -1);
264
- }
265
- return {
266
- x: h,
267
- y: u,
268
- placement: d,
269
- strategy: o,
270
- middlewareData: p
271
- };
272
- }, oe = function(t) {
273
- return t === void 0 && (t = {}), {
274
- name: "flip",
275
- options: t,
276
- async fn(e) {
277
- var n, i;
278
- const {
279
- placement: o,
280
- middlewareData: r,
281
- rects: s,
282
- initialPlacement: c,
283
- platform: l,
284
- elements: a
285
- } = e, {
286
- mainAxis: h = !0,
287
- crossAxis: u = !0,
288
- fallbackPlacements: d,
289
- fallbackStrategy: f = "bestFit",
290
- fallbackAxisSideDirection: p = "none",
291
- flipAlignment: m = !0,
292
- ...y
293
- } = it(t, e);
294
- if ((n = r.arrow) != null && n.alignmentOffset)
295
- return {};
296
- const g = N(o), w = F(c), x = N(c) === c, v = await (l.isRTL == null ? void 0 : l.isRTL(a.floating)), O = d || (x || !m ? [tt(c)] : qt(c)), b = p !== "none";
297
- !d && b && O.push(...Qt(c, m, p, v));
298
- const z = [c, ...O], lt = await l.detectOverflow(e, y), G = [];
299
- let H = ((i = r.flip) == null ? void 0 : i.overflows) || [];
300
- if (h && G.push(lt[g]), u) {
301
- const M = Yt(o, s, v);
302
- G.push(lt[M[0]], lt[M[1]]);
303
- }
304
- if (H = [...H, {
305
- placement: o,
306
- overflows: G
307
- }], !G.every((M) => M <= 0)) {
308
- var wt, xt;
309
- const M = (((wt = r.flip) == null ? void 0 : wt.index) || 0) + 1, at = z[M];
310
- if (at && (!(u === "alignment" ? w !== F(at) : !1) || // We leave the current main axis only if every placement on that axis
311
- // overflows the main axis.
312
- H.every((C) => F(C.placement) === w ? C.overflows[0] > 0 : !0)))
313
- return {
314
- data: {
315
- index: M,
316
- overflows: H
317
- },
318
- reset: {
319
- placement: at
320
- }
321
- };
322
- let Y = (xt = H.filter(($) => $.overflows[0] <= 0).sort(($, C) => $.overflows[1] - C.overflows[1])[0]) == null ? void 0 : xt.placement;
323
- if (!Y)
324
- switch (f) {
325
- case "bestFit": {
326
- var vt;
327
- const $ = (vt = H.filter((C) => {
328
- if (b) {
329
- const k = F(C.placement);
330
- return k === w || // Create a bias to the `y` side axis due to horizontal
331
- // reading directions favoring greater width.
332
- k === "y";
333
- }
334
- return !0;
335
- }).map((C) => [C.placement, C.overflows.filter((k) => k > 0).reduce((k, zt) => k + zt, 0)]).sort((C, k) => C[1] - k[1])[0]) == null ? void 0 : vt[0];
336
- $ && (Y = $);
337
- break;
338
- }
339
- case "initialPlacement":
340
- Y = c;
341
- break;
342
- }
343
- if (o !== Y)
344
- return {
345
- reset: {
346
- placement: Y
347
- }
348
- };
349
- }
350
- return {};
351
- }
352
- };
353
- }, se = /* @__PURE__ */ new Set(["left", "top"]);
354
- async function re(t, e) {
355
- const {
356
- placement: n,
357
- platform: i,
358
- elements: o
359
- } = t, r = await (i.isRTL == null ? void 0 : i.isRTL(o.floating)), s = N(n), c = nt(n), l = F(n) === "y", a = se.has(s) ? -1 : 1, h = r && l ? -1 : 1, u = it(e, t);
360
- let {
361
- mainAxis: d,
362
- crossAxis: f,
363
- alignmentAxis: p
364
- } = typeof u == "number" ? {
365
- mainAxis: u,
366
- crossAxis: 0,
367
- alignmentAxis: null
368
- } : {
369
- mainAxis: u.mainAxis || 0,
370
- crossAxis: u.crossAxis || 0,
371
- alignmentAxis: u.alignmentAxis
372
- };
373
- return c && typeof p == "number" && (f = c === "end" ? p * -1 : p), l ? {
374
- x: f * h,
375
- y: d * a
376
- } : {
377
- x: d * a,
378
- y: f * h
379
- };
380
- }
381
- const ce = function(t) {
382
- return t === void 0 && (t = 0), {
383
- name: "offset",
384
- options: t,
385
- async fn(e) {
386
- var n, i;
387
- const {
388
- x: o,
389
- y: r,
390
- placement: s,
391
- middlewareData: c
392
- } = e, l = await re(e, t);
393
- return s === ((n = c.offset) == null ? void 0 : n.placement) && (i = c.arrow) != null && i.alignmentOffset ? {} : {
394
- x: o + l.x,
395
- y: r + l.y,
396
- data: {
397
- ...l,
398
- placement: s
399
- }
400
- };
401
- }
402
- };
403
- }, le = function(t) {
404
- return t === void 0 && (t = {}), {
405
- name: "shift",
406
- options: t,
407
- async fn(e) {
408
- const {
409
- x: n,
410
- y: i,
411
- placement: o,
412
- platform: r
413
- } = e, {
414
- mainAxis: s = !0,
415
- crossAxis: c = !1,
416
- limiter: l = {
417
- fn: (g) => {
418
- let {
419
- x: w,
420
- y: x
421
- } = g;
422
- return {
423
- x: w,
424
- y: x
425
- };
426
- }
427
- },
428
- ...a
429
- } = it(t, e), h = {
430
- x: n,
431
- y: i
432
- }, u = await r.detectOverflow(e, a), d = F(N(o)), f = St(d);
433
- let p = h[f], m = h[d];
434
- if (s) {
435
- const g = f === "y" ? "top" : "left", w = f === "y" ? "bottom" : "right", x = p + u[g], v = p - u[w];
436
- p = bt(x, p, v);
437
- }
438
- if (c) {
439
- const g = d === "y" ? "top" : "left", w = d === "y" ? "bottom" : "right", x = m + u[g], v = m - u[w];
440
- m = bt(x, m, v);
441
- }
442
- const y = l.fn({
443
- ...e,
444
- [f]: p,
445
- [d]: m
446
- });
447
- return {
448
- ...y,
449
- data: {
450
- x: y.x - n,
451
- y: y.y - i,
452
- enabled: {
453
- [f]: s,
454
- [d]: c
455
- }
456
- }
457
- };
458
- }
459
- };
460
- };
461
- function ot() {
462
- return typeof window < "u";
463
- }
464
- function K(t) {
465
- return Ft(t) ? (t.nodeName || "").toLowerCase() : "#document";
466
- }
467
- function _(t) {
468
- var e;
469
- return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
470
- }
471
- function S(t) {
472
- var e;
473
- return (e = (Ft(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
474
- }
475
- function Ft(t) {
476
- return ot() ? t instanceof Node || t instanceof _(t).Node : !1;
477
- }
478
- function A(t) {
479
- return ot() ? t instanceof Element || t instanceof _(t).Element : !1;
480
- }
481
- function P(t) {
482
- return ot() ? t instanceof HTMLElement || t instanceof _(t).HTMLElement : !1;
483
- }
484
- function Ct(t) {
485
- return !ot() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof _(t).ShadowRoot;
486
- }
487
- function U(t) {
488
- const {
489
- overflow: e,
490
- overflowX: n,
491
- overflowY: i,
492
- display: o
493
- } = T(t);
494
- return /auto|scroll|overlay|hidden|clip/.test(e + i + n) && o !== "inline" && o !== "contents";
495
- }
496
- function ae(t) {
497
- return /^(table|td|th)$/.test(K(t));
498
- }
499
- function st(t) {
500
- try {
501
- if (t.matches(":popover-open"))
502
- return !0;
503
- } catch {
504
- }
505
- try {
506
- return t.matches(":modal");
507
- } catch {
508
- return !1;
509
- }
510
- }
511
- const fe = /transform|translate|scale|rotate|perspective|filter/, ue = /paint|layout|strict|content/, V = (t) => !!t && t !== "none";
512
- let ft;
513
- function gt(t) {
514
- const e = A(t) ? T(t) : t;
515
- return V(e.transform) || V(e.translate) || V(e.scale) || V(e.rotate) || V(e.perspective) || !mt() && (V(e.backdropFilter) || V(e.filter)) || fe.test(e.willChange || "") || ue.test(e.contain || "");
516
- }
517
- function he(t) {
518
- let e = D(t);
519
- for (; P(e) && !X(e); ) {
520
- if (gt(e))
521
- return e;
522
- if (st(e))
523
- return null;
524
- e = D(e);
525
- }
526
- return null;
527
- }
528
- function mt() {
529
- return ft == null && (ft = typeof CSS < "u" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none")), ft;
530
- }
531
- function X(t) {
532
- return /^(html|body|#document)$/.test(K(t));
533
- }
534
- function T(t) {
535
- return _(t).getComputedStyle(t);
536
- }
537
- function rt(t) {
538
- return A(t) ? {
539
- scrollLeft: t.scrollLeft,
540
- scrollTop: t.scrollTop
541
- } : {
542
- scrollLeft: t.scrollX,
543
- scrollTop: t.scrollY
544
- };
545
- }
546
- function D(t) {
547
- if (K(t) === "html")
548
- return t;
549
- const e = (
550
- // Step into the shadow DOM of the parent of a slotted node.
551
- t.assignedSlot || // DOM Element detected.
552
- t.parentNode || // ShadowRoot detected.
553
- Ct(t) && t.host || // Fallback.
554
- S(t)
555
- );
556
- return Ct(e) ? e.host : e;
557
- }
558
- function Dt(t) {
559
- const e = D(t);
560
- return X(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : P(e) && U(e) ? e : Dt(e);
561
- }
562
- function q(t, e, n) {
563
- var i;
564
- e === void 0 && (e = []), n === void 0 && (n = !0);
565
- const o = Dt(t), r = o === ((i = t.ownerDocument) == null ? void 0 : i.body), s = _(o);
566
- if (r) {
567
- const c = dt(s);
568
- return e.concat(s, s.visualViewport || [], U(o) ? o : [], c && n ? q(c) : []);
569
- } else
570
- return e.concat(o, q(o, [], n));
571
- }
572
- function dt(t) {
573
- return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
574
- }
575
- function Mt(t) {
576
- const e = T(t);
577
- let n = parseFloat(e.width) || 0, i = parseFloat(e.height) || 0;
578
- const o = P(t), r = o ? t.offsetWidth : n, s = o ? t.offsetHeight : i, c = Z(n) !== r || Z(i) !== s;
579
- return c && (n = r, i = s), {
580
- width: n,
581
- height: i,
582
- $: c
583
- };
584
- }
585
- function yt(t) {
586
- return A(t) ? t : t.contextElement;
587
- }
588
- function I(t) {
589
- const e = yt(t);
590
- if (!P(e))
591
- return L(1);
592
- const n = e.getBoundingClientRect(), {
593
- width: i,
594
- height: o,
595
- $: r
596
- } = Mt(e);
597
- let s = (r ? Z(n.width) : n.width) / i, c = (r ? Z(n.height) : n.height) / o;
598
- return (!s || !Number.isFinite(s)) && (s = 1), (!c || !Number.isFinite(c)) && (c = 1), {
599
- x: s,
600
- y: c
601
- };
602
- }
603
- const de = /* @__PURE__ */ L(0);
604
- function $t(t) {
605
- const e = _(t);
606
- return !mt() || !e.visualViewport ? de : {
607
- x: e.visualViewport.offsetLeft,
608
- y: e.visualViewport.offsetTop
609
- };
610
- }
611
- function pe(t, e, n) {
612
- return e === void 0 && (e = !1), !n || e && n !== _(t) ? !1 : e;
613
- }
614
- function B(t, e, n, i) {
615
- e === void 0 && (e = !1), n === void 0 && (n = !1);
616
- const o = t.getBoundingClientRect(), r = yt(t);
617
- let s = L(1);
618
- e && (i ? A(i) && (s = I(i)) : s = I(t));
619
- const c = pe(r, n, i) ? $t(r) : L(0);
620
- let l = (o.left + c.x) / s.x, a = (o.top + c.y) / s.y, h = o.width / s.x, u = o.height / s.y;
621
- if (r) {
622
- const d = _(r), f = i && A(i) ? _(i) : i;
623
- let p = d, m = dt(p);
624
- for (; m && i && f !== p; ) {
625
- const y = I(m), g = m.getBoundingClientRect(), w = T(m), x = g.left + (m.clientLeft + parseFloat(w.paddingLeft)) * y.x, v = g.top + (m.clientTop + parseFloat(w.paddingTop)) * y.y;
626
- l *= y.x, a *= y.y, h *= y.x, u *= y.y, l += x, a += v, p = _(m), m = dt(p);
627
- }
628
- }
629
- return et({
630
- width: h,
631
- height: u,
632
- x: l,
633
- y: a
634
- });
635
- }
636
- function ct(t, e) {
637
- const n = rt(t).scrollLeft;
638
- return e ? e.left + n : B(S(t)).left + n;
639
- }
640
- function Vt(t, e) {
641
- const n = t.getBoundingClientRect(), i = n.left + e.scrollLeft - ct(t, n), o = n.top + e.scrollTop;
642
- return {
643
- x: i,
644
- y: o
645
- };
646
- }
647
- function ge(t) {
648
- let {
649
- elements: e,
650
- rect: n,
651
- offsetParent: i,
652
- strategy: o
653
- } = t;
654
- const r = o === "fixed", s = S(i), c = e ? st(e.floating) : !1;
655
- if (i === s || c && r)
656
- return n;
657
- let l = {
658
- scrollLeft: 0,
659
- scrollTop: 0
660
- }, a = L(1);
661
- const h = L(0), u = P(i);
662
- if ((u || !u && !r) && ((K(i) !== "body" || U(s)) && (l = rt(i)), u)) {
663
- const f = B(i);
664
- a = I(i), h.x = f.x + i.clientLeft, h.y = f.y + i.clientTop;
665
- }
666
- const d = s && !u && !r ? Vt(s, l) : L(0);
667
- return {
668
- width: n.width * a.x,
669
- height: n.height * a.y,
670
- x: n.x * a.x - l.scrollLeft * a.x + h.x + d.x,
671
- y: n.y * a.y - l.scrollTop * a.y + h.y + d.y
672
- };
673
- }
674
- function me(t) {
675
- return Array.from(t.getClientRects());
676
- }
677
- function ye(t) {
678
- const e = S(t), n = rt(t), i = t.ownerDocument.body, o = W(e.scrollWidth, e.clientWidth, i.scrollWidth, i.clientWidth), r = W(e.scrollHeight, e.clientHeight, i.scrollHeight, i.clientHeight);
679
- let s = -n.scrollLeft + ct(t);
680
- const c = -n.scrollTop;
681
- return T(i).direction === "rtl" && (s += W(e.clientWidth, i.clientWidth) - o), {
682
- width: o,
683
- height: r,
684
- x: s,
685
- y: c
686
- };
687
- }
688
- const At = 25;
689
- function we(t, e) {
690
- const n = _(t), i = S(t), o = n.visualViewport;
691
- let r = i.clientWidth, s = i.clientHeight, c = 0, l = 0;
692
- if (o) {
693
- r = o.width, s = o.height;
694
- const h = mt();
695
- (!h || h && e === "fixed") && (c = o.offsetLeft, l = o.offsetTop);
696
- }
697
- const a = ct(i);
698
- if (a <= 0) {
699
- const h = i.ownerDocument, u = h.body, d = getComputedStyle(u), f = h.compatMode === "CSS1Compat" && parseFloat(d.marginLeft) + parseFloat(d.marginRight) || 0, p = Math.abs(i.clientWidth - u.clientWidth - f);
700
- p <= At && (r -= p);
701
- } else a <= At && (r += a);
702
- return {
703
- width: r,
704
- height: s,
705
- x: c,
706
- y: l
707
- };
708
- }
709
- function xe(t, e) {
710
- const n = B(t, !0, e === "fixed"), i = n.top + t.clientTop, o = n.left + t.clientLeft, r = P(t) ? I(t) : L(1), s = t.clientWidth * r.x, c = t.clientHeight * r.y, l = o * r.x, a = i * r.y;
711
- return {
712
- width: s,
713
- height: c,
714
- x: l,
715
- y: a
716
- };
717
- }
718
- function Tt(t, e, n) {
719
- let i;
720
- if (e === "viewport")
721
- i = we(t, n);
722
- else if (e === "document")
723
- i = ye(S(t));
724
- else if (A(e))
725
- i = xe(e, n);
726
- else {
727
- const o = $t(t);
728
- i = {
729
- x: e.x - o.x,
730
- y: e.y - o.y,
731
- width: e.width,
732
- height: e.height
733
- };
734
- }
735
- return et(i);
736
- }
737
- function Wt(t, e) {
738
- const n = D(t);
739
- return n === e || !A(n) || X(n) ? !1 : T(n).position === "fixed" || Wt(n, e);
740
- }
741
- function ve(t, e) {
742
- const n = e.get(t);
743
- if (n)
744
- return n;
745
- let i = q(t, [], !1).filter((c) => A(c) && K(c) !== "body"), o = null;
746
- const r = T(t).position === "fixed";
747
- let s = r ? D(t) : t;
748
- for (; A(s) && !X(s); ) {
749
- const c = T(s), l = gt(s);
750
- !l && c.position === "fixed" && (o = null), (r ? !l && !o : !l && c.position === "static" && !!o && (o.position === "absolute" || o.position === "fixed") || U(s) && !l && Wt(t, s)) ? i = i.filter((h) => h !== s) : o = c, s = D(s);
751
- }
752
- return e.set(t, i), i;
753
- }
754
- function be(t) {
755
- let {
756
- element: e,
757
- boundary: n,
758
- rootBoundary: i,
759
- strategy: o
760
- } = t;
761
- const s = [...n === "clippingAncestors" ? st(e) ? [] : ve(e, this._c) : [].concat(n), i], c = Tt(e, s[0], o);
762
- let l = c.top, a = c.right, h = c.bottom, u = c.left;
763
- for (let d = 1; d < s.length; d++) {
764
- const f = Tt(e, s[d], o);
765
- l = W(f.top, l), a = Q(f.right, a), h = Q(f.bottom, h), u = W(f.left, u);
766
- }
767
- return {
768
- width: a - u,
769
- height: h - l,
770
- x: u,
771
- y: l
772
- };
773
- }
774
- function _e(t) {
775
- const {
776
- width: e,
777
- height: n
778
- } = Mt(t);
779
- return {
780
- width: e,
781
- height: n
782
- };
783
- }
784
- function Re(t, e, n) {
785
- const i = P(e), o = S(e), r = n === "fixed", s = B(t, !0, r, e);
786
- let c = {
787
- scrollLeft: 0,
788
- scrollTop: 0
789
- };
790
- const l = L(0);
791
- function a() {
792
- l.x = ct(o);
793
- }
794
- if (i || !i && !r)
795
- if ((K(e) !== "body" || U(o)) && (c = rt(e)), i) {
796
- const f = B(e, !0, r, e);
797
- l.x = f.x + e.clientLeft, l.y = f.y + e.clientTop;
798
- } else o && a();
799
- r && !i && o && a();
800
- const h = o && !i && !r ? Vt(o, c) : L(0), u = s.left + c.scrollLeft - l.x - h.x, d = s.top + c.scrollTop - l.y - h.y;
801
- return {
802
- x: u,
803
- y: d,
804
- width: s.width,
805
- height: s.height
806
- };
807
- }
808
- function ut(t) {
809
- return T(t).position === "static";
810
- }
811
- function Et(t, e) {
812
- if (!P(t) || T(t).position === "fixed")
813
- return null;
814
- if (e)
815
- return e(t);
816
- let n = t.offsetParent;
817
- return S(t) === n && (n = n.ownerDocument.body), n;
818
- }
819
- function Nt(t, e) {
820
- const n = _(t);
821
- if (st(t))
822
- return n;
823
- if (!P(t)) {
824
- let o = D(t);
825
- for (; o && !X(o); ) {
826
- if (A(o) && !ut(o))
827
- return o;
828
- o = D(o);
829
- }
830
- return n;
831
- }
832
- let i = Et(t, e);
833
- for (; i && ae(i) && ut(i); )
834
- i = Et(i, e);
835
- return i && X(i) && ut(i) && !gt(i) ? n : i || he(t) || n;
836
- }
837
- const Oe = async function(t) {
838
- const e = this.getOffsetParent || Nt, n = this.getDimensions, i = await n(t.floating);
839
- return {
840
- reference: Re(t.reference, await e(t.floating), t.strategy),
841
- floating: {
842
- x: 0,
843
- y: 0,
844
- width: i.width,
845
- height: i.height
846
- }
847
- };
848
- };
849
- function Ce(t) {
850
- return T(t).direction === "rtl";
851
- }
852
- const Ae = {
853
- convertOffsetParentRelativeRectToViewportRelativeRect: ge,
854
- getDocumentElement: S,
855
- getClippingRect: be,
856
- getOffsetParent: Nt,
857
- getElementRects: Oe,
858
- getClientRects: me,
859
- getDimensions: _e,
860
- getScale: I,
861
- isElement: A,
862
- isRTL: Ce
863
- };
864
- function Bt(t, e) {
865
- return t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height;
866
- }
867
- function Te(t, e) {
868
- let n = null, i;
869
- const o = S(t);
870
- function r() {
871
- var c;
872
- clearTimeout(i), (c = n) == null || c.disconnect(), n = null;
873
- }
874
- function s(c, l) {
875
- c === void 0 && (c = !1), l === void 0 && (l = 1), r();
876
- const a = t.getBoundingClientRect(), {
877
- left: h,
878
- top: u,
879
- width: d,
880
- height: f
881
- } = a;
882
- if (c || e(), !d || !f)
883
- return;
884
- const p = J(u), m = J(o.clientWidth - (h + d)), y = J(o.clientHeight - (u + f)), g = J(h), x = {
885
- rootMargin: -p + "px " + -m + "px " + -y + "px " + -g + "px",
886
- threshold: W(0, Q(1, l)) || 1
887
- };
888
- let v = !0;
889
- function O(b) {
890
- const z = b[0].intersectionRatio;
891
- if (z !== l) {
892
- if (!v)
893
- return s();
894
- z ? s(!1, z) : i = setTimeout(() => {
895
- s(!1, 1e-7);
896
- }, 1e3);
897
- }
898
- z === 1 && !Bt(a, t.getBoundingClientRect()) && s(), v = !1;
899
- }
900
- try {
901
- n = new IntersectionObserver(O, {
902
- ...x,
903
- // Handle <iframe>s
904
- root: o.ownerDocument
905
- });
906
- } catch {
907
- n = new IntersectionObserver(O, x);
908
- }
909
- n.observe(t);
910
- }
911
- return s(!0), r;
912
- }
913
- function Ee(t, e, n, i) {
914
- i === void 0 && (i = {});
915
- const {
916
- ancestorScroll: o = !0,
917
- ancestorResize: r = !0,
918
- elementResize: s = typeof ResizeObserver == "function",
919
- layoutShift: c = typeof IntersectionObserver == "function",
920
- animationFrame: l = !1
921
- } = i, a = yt(t), h = o || r ? [...a ? q(a) : [], ...e ? q(e) : []] : [];
922
- h.forEach((g) => {
923
- o && g.addEventListener("scroll", n, {
924
- passive: !0
925
- }), r && g.addEventListener("resize", n);
926
- });
927
- const u = a && c ? Te(a, n) : null;
928
- let d = -1, f = null;
929
- s && (f = new ResizeObserver((g) => {
930
- let [w] = g;
931
- w && w.target === a && f && e && (f.unobserve(e), cancelAnimationFrame(d), d = requestAnimationFrame(() => {
932
- var x;
933
- (x = f) == null || x.observe(e);
934
- })), n();
935
- }), a && !l && f.observe(a), e && f.observe(e));
936
- let p, m = l ? B(t) : null;
937
- l && y();
938
- function y() {
939
- const g = B(t);
940
- m && !Bt(m, g) && n(), m = g, p = requestAnimationFrame(y);
941
- }
942
- return n(), () => {
943
- var g;
944
- h.forEach((w) => {
945
- o && w.removeEventListener("scroll", n), r && w.removeEventListener("resize", n);
946
- }), u == null || u(), (g = f) == null || g.disconnect(), f = null, l && cancelAnimationFrame(p);
947
- };
948
- }
949
- const Le = ce, Se = le, Pe = oe, ke = (t, e, n) => {
950
- const i = /* @__PURE__ */ new Map(), o = {
951
- platform: Ae,
952
- ...n
953
- }, r = {
954
- ...o.platform,
955
- _c: i
956
- };
957
- return ne(t, e, {
958
- ...o,
959
- platform: r
960
- });
961
- };
962
- var Fe = Object.defineProperty, De = Object.getOwnPropertyDescriptor, E = (t, e, n, i) => {
963
- for (var o = i > 1 ? void 0 : i ? De(e, n) : e, r = t.length - 1, s; r >= 0; r--)
964
- (s = t[r]) && (o = (i ? s(e, n, o) : s(o)) || o);
965
- return i && o && Fe(e, n, o), o;
966
- };
967
- const Me = "fhi-tooltip";
968
- let R = class extends It {
969
- constructor() {
970
- super(...arguments), this.message = "", this.placement = "top", this.delay = 500, this.trigger = "hover", this.maxWidth = "18.75rem", this._timeoutId = void 0, this._autoPositioningCleanup = () => {
971
- }, this._isVisible = !1, this._isFadingOut = !1, this._position = {
972
- top: 0,
973
- left: 0
974
- }, this._handlePotentialClickOutside = (t) => {
975
- this.trigger === "click" && this._isVisible && !this.contains(t.target) && this._hideTooltip();
976
- }, this.__handlePotentialEscapeKeyPress = (t) => {
977
- t.key === "Escape" && this._isVisible && this._hideTooltip();
978
- };
979
- }
980
- update(t) {
981
- t.has("trigger") && this.trigger !== "click" && this.trigger !== "hover" && (this.trigger = "hover"), super.update(t);
982
- }
983
- _showTooltip() {
984
- this._isVisible || this.message && (this._positionTooltip(this.placement), this._isVisible = !0, window.addEventListener("click", this._handlePotentialClickOutside), window.addEventListener("keydown", this.__handlePotentialEscapeKeyPress));
985
- }
986
- _hideTooltip() {
987
- this._isVisible && (this._isFadingOut = !0, setTimeout(() => {
988
- this._isVisible = !1, this._isFadingOut = !1, this._autoPositioningCleanup(), window.removeEventListener("click", this._handlePotentialClickOutside), window.removeEventListener(
989
- "keydown",
990
- this.__handlePotentialEscapeKeyPress
991
- );
992
- }, 150));
993
- }
994
- _positionTooltip(t) {
995
- this._autoPositioningCleanup = Ee(
996
- this._anchor,
997
- this._tooltip,
998
- () => {
999
- ke(this._anchor, this._tooltip, {
1000
- placement: t || "top",
1001
- strategy: "fixed",
1002
- middleware: [
1003
- Pe({ fallbackAxisSideDirection: "start" }),
1004
- Se(),
1005
- Le(4)
1006
- ]
1007
- }).then(({ x: e, y: n }) => {
1008
- this._position = {
1009
- top: n,
1010
- left: e
1011
- };
1012
- });
1013
- }
1014
- );
1015
- }
1016
- _handleMouseEnter() {
1017
- this.trigger === "hover" && (this._timeoutId = setTimeout(() => {
1018
- this._showTooltip();
1019
- }, this.delay));
1020
- }
1021
- _handleMouseLeave() {
1022
- this.trigger === "hover" && (clearTimeout(this._timeoutId), this._hideTooltip());
1023
- }
1024
- _handleClick() {
1025
- this.trigger === "click" && (this._isVisible ? this._hideTooltip() : this._showTooltip());
1026
- }
1027
- render() {
1028
- return Xt`
1029
- <div
1030
- id="tooltip-anchor"
1031
- @mouseenter=${this._handleMouseEnter}
1032
- @mouseleave=${this._handleMouseLeave}
1033
- @focusin=${this._handleMouseEnter}
1034
- @focusout=${this._handleMouseLeave}
1035
- @touchstart=${this._handleMouseEnter}
1036
- @touchend=${this._handleMouseLeave}
1037
- @touchcancel=${this._handleMouseLeave}
1038
- @click=${this._handleClick}
1039
- >
1040
- <slot aria-describedby="tooltip"></slot>
1041
- <section
1042
- id="tooltip"
1043
- role="tooltip"
1044
- aria-hidden=${!this._isVisible}
1045
- ?fading-out=${this._isFadingOut}
1046
- style="
1047
- transform: translate3d(${this._position.left}px, ${this._position.top}px, 0); max-width: ${this.maxWidth};
1048
- max-width: ${this.maxWidth};
1049
- "
1050
- >
1051
- <span>${this.message}</span>
1052
- </section>
1053
- </div>
1054
- `;
1055
- }
1056
- };
1057
- R.styles = Ht`
1058
- :host {
1059
- --color-background: var(--fhi-color-neutral-base-active);
1060
- --color-text: var(--fhi-color-neutral-text-inverted);
1061
- --color-border: none;
1062
-
1063
- --typography-font-family: var(--fhi-font-family-default);
1064
- --typography-font-size: var(--fhi-typography-body-small-font-size);
1065
- --typography-font-style: normal;
1066
- --typography-font-weight: var(--fhi-typography-body-small-font-weight);
1067
- --typography-line-height: var(--fhi-typography-body-small-line-height);
1068
- --typography-letter-spacing: var(
1069
- --fhi-typography-body-small-letter-spacing
1070
- );
1071
-
1072
- --dimension-border-radius: var(--fhi-border-radius-050);
1073
- --dimension-border-width: none;
1074
- --dimension-padding: var(--fhi-spacing-050) var(--fhi-spacing-100);
1075
- }
1076
-
1077
- :host {
1078
- #tooltip-anchor {
1079
- width: max-content;
1080
- height: max-content;
1081
- }
1082
-
1083
- #tooltip {
1084
- top: 0;
1085
- left: 0;
1086
- position: fixed;
1087
- border: var(--dimension-border-width) solid var(--color-border);
1088
- visibility: hidden;
1089
- opacity: 0;
1090
- margin: 0;
1091
- transition: opacity 0.15s ease-in-out;
1092
- width: max-content;
1093
- padding: var(--dimension-padding);
1094
- border-radius: var(--dimension-border-radius);
1095
- background-color: var(--color-background);
1096
- color: var(--color-text);
1097
- font-family: var(--typography-font-family);
1098
- -webkit-font-smoothing: antialiased;
1099
- font-size: var(--typography-font-size);
1100
- font-weight: var(--typography-font-weight);
1101
- line-height: var(--typography-line-height);
1102
- letter-spacing: var(--typography-letter-spacing);
1103
- font-variant-numeric: lining-nums proportional-nums;
1104
- font-style: normal;
1105
- cursor: default;
1106
- &[aria-hidden='false'] {
1107
- z-index: 1000;
1108
- visibility: visible;
1109
- opacity: 1;
1110
- }
1111
- &[fading-out] {
1112
- opacity: 0;
1113
- }
1114
- &::after {
1115
- content: '';
1116
- position: absolute;
1117
- top: -4px;
1118
- right: -4px;
1119
- bottom: -4px;
1120
- left: -4px;
1121
- }
1122
- }
1123
- }
1124
- `;
1125
- E([
1126
- j({ type: String })
1127
- ], R.prototype, "message", 2);
1128
- E([
1129
- j({ type: String })
1130
- ], R.prototype, "placement", 2);
1131
- E([
1132
- j({ type: Number })
1133
- ], R.prototype, "delay", 2);
1134
- E([
1135
- j({ type: String })
1136
- ], R.prototype, "trigger", 2);
1137
- E([
1138
- j({ type: String, attribute: "max-width" })
1139
- ], R.prototype, "maxWidth", 2);
1140
- E([
1141
- Lt("#tooltip-anchor")
1142
- ], R.prototype, "_anchor", 2);
1143
- E([
1144
- Lt("#tooltip")
1145
- ], R.prototype, "_tooltip", 2);
1146
- E([
1147
- pt()
1148
- ], R.prototype, "_isVisible", 2);
1149
- E([
1150
- pt()
1151
- ], R.prototype, "_isFadingOut", 2);
1152
- E([
1153
- pt()
1154
- ], R.prototype, "_position", 2);
1155
- R = E([
1156
- jt(Me)
1157
- ], R);
1158
- export {
1159
- R as FhiTooltip,
1160
- Me as FhiTooltipSelector
1161
- };
1162
- //# sourceMappingURL=fhi-tooltip.js.map
1
+ import { n as e, t } from "./fhi-tooltip.component-DJNDfrHK.js";
2
+ export { t as FhiTooltip, e as FhiTooltipSelector };