@folkehelseinstituttet/designsystem 0.30.0 → 0.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/fhi-tooltip.js CHANGED
@@ -1,69 +1,66 @@
1
- import { n as j, i as Bt, a as zt, b as Ht, t as It } from "./property-DGdAXcEz.js";
2
- import { e as St } from "./query-NJDNu0-P.js";
1
+ import { n as j, i as Ht, a as It, b as Xt, t as jt } from "./property-DGdAXcEz.js";
2
+ import { e as Lt } from "./query-NJDNu0-P.js";
3
3
  /**
4
4
  * @license
5
5
  * Copyright 2017 Google LLC
6
6
  * SPDX-License-Identifier: BSD-3-Clause
7
7
  */
8
- function ht(t) {
8
+ function pt(t) {
9
9
  return j({ ...t, state: !0, attribute: !1 });
10
10
  }
11
- const J = Math.min, $ = Math.max, Q = Math.round, G = Math.floor, L = (t) => ({
11
+ const Q = Math.min, W = Math.max, Z = Math.round, J = Math.floor, L = (t) => ({
12
12
  x: t,
13
13
  y: t
14
- }), jt = {
14
+ }), Kt = {
15
15
  left: "right",
16
16
  right: "left",
17
17
  bottom: "top",
18
18
  top: "bottom"
19
- }, Xt = {
20
- start: "end",
21
- end: "start"
22
19
  };
23
- function xt(t, e, n) {
24
- return $(t, J(e, n));
20
+ function bt(t, e, n) {
21
+ return W(t, Q(e, n));
25
22
  }
26
- function et(t, e) {
23
+ function it(t, e) {
27
24
  return typeof t == "function" ? t(e) : t;
28
25
  }
29
- function W(t) {
26
+ function N(t) {
30
27
  return t.split("-")[0];
31
28
  }
32
29
  function nt(t) {
33
30
  return t.split("-")[1];
34
31
  }
35
- function Tt(t) {
32
+ function St(t) {
36
33
  return t === "x" ? "y" : "x";
37
34
  }
38
- function Lt(t) {
35
+ function Pt(t) {
39
36
  return t === "y" ? "height" : "width";
40
37
  }
41
- const Kt = /* @__PURE__ */ new Set(["top", "bottom"]);
42
38
  function F(t) {
43
- return Kt.has(W(t)) ? "y" : "x";
39
+ const e = t[0];
40
+ return e === "t" || e === "b" ? "y" : "x";
44
41
  }
45
- function Et(t) {
46
- return Tt(F(t));
42
+ function kt(t) {
43
+ return St(F(t));
47
44
  }
48
45
  function Yt(t, e, n) {
49
46
  n === void 0 && (n = !1);
50
- const i = nt(t), o = Et(t), r = Lt(o);
47
+ const i = nt(t), o = kt(t), r = Pt(o);
51
48
  let s = o === "x" ? i === (n ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
52
- return e.reference[r] > e.floating[r] && (s = Z(s)), [s, Z(s)];
49
+ return e.reference[r] > e.floating[r] && (s = tt(s)), [s, tt(s)];
53
50
  }
54
51
  function qt(t) {
55
- const e = Z(t);
56
- return [ft(t), e, ft(e)];
52
+ const e = tt(t);
53
+ return [ht(t), e, ht(e)];
57
54
  }
58
- function ft(t) {
59
- return t.replace(/start|end/g, (e) => Xt[e]);
55
+ function ht(t) {
56
+ return t.includes("start") ? t.replace("start", "end") : t.replace("end", "start");
60
57
  }
61
- const vt = ["left", "right"], bt = ["right", "left"], Ut = ["top", "bottom"], Gt = ["bottom", "top"];
58
+ const _t = ["left", "right"], Rt = ["right", "left"], Ut = ["top", "bottom"], Gt = ["bottom", "top"];
62
59
  function Jt(t, e, n) {
63
60
  switch (t) {
64
61
  case "top":
65
62
  case "bottom":
66
- return n ? e ? bt : vt : e ? vt : bt;
63
+ return n ? e ? Rt : _t : e ? _t : Rt;
67
64
  case "left":
68
65
  case "right":
69
66
  return e ? Ut : Gt;
@@ -73,11 +70,12 @@ function Jt(t, e, n) {
73
70
  }
74
71
  function Qt(t, e, n, i) {
75
72
  const o = nt(t);
76
- let r = Jt(W(t), n === "start", i);
77
- return o && (r = r.map((s) => s + "-" + o), e && (r = r.concat(r.map(ft)))), r;
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;
78
75
  }
79
- function Z(t) {
80
- return t.replace(/left|right|bottom|top/g, (e) => jt[e]);
76
+ function tt(t) {
77
+ const e = N(t);
78
+ return Kt[e] + t.slice(e.length);
81
79
  }
82
80
  function Zt(t) {
83
81
  return {
@@ -96,7 +94,7 @@ function te(t) {
96
94
  left: t
97
95
  };
98
96
  }
99
- function tt(t) {
97
+ function et(t) {
100
98
  const {
101
99
  x: e,
102
100
  y: n,
@@ -114,14 +112,14 @@ function tt(t) {
114
112
  y: n
115
113
  };
116
114
  }
117
- function _t(t, e, n) {
115
+ function Ot(t, e, n) {
118
116
  let {
119
117
  reference: i,
120
118
  floating: o
121
119
  } = t;
122
- const r = F(e), s = Et(e), l = Lt(s), c = W(e), a = r === "y", h = i.x + i.width / 2 - o.width / 2, u = i.y + i.height / 2 - o.height / 2, d = i[l] / 2 - o[l] / 2;
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;
123
121
  let f;
124
- switch (c) {
122
+ switch (l) {
125
123
  case "top":
126
124
  f = {
127
125
  x: h,
@@ -170,50 +168,53 @@ async function ee(t, e) {
170
168
  y: o,
171
169
  platform: r,
172
170
  rects: s,
173
- elements: l,
174
- strategy: c
171
+ elements: c,
172
+ strategy: l
175
173
  } = t, {
176
174
  boundary: a = "clippingAncestors",
177
175
  rootBoundary: h = "viewport",
178
176
  elementContext: u = "floating",
179
177
  altBoundary: d = !1,
180
178
  padding: f = 0
181
- } = et(e, t), p = te(f), y = l[d ? u === "floating" ? "reference" : "floating" : u], m = tt(await r.getClippingRect({
182
- element: (n = await (r.isElement == null ? void 0 : r.isElement(y))) == null || n ? y : y.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(l.floating)),
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)),
183
181
  boundary: a,
184
182
  rootBoundary: h,
185
- strategy: c
183
+ strategy: l
186
184
  })), w = u === "floating" ? {
187
185
  x: i,
188
186
  y: o,
189
187
  width: s.floating.width,
190
188
  height: s.floating.height
191
- } : s.reference, x = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(l.floating)), v = await (r.isElement == null ? void 0 : r.isElement(x)) ? await (r.getScale == null ? void 0 : r.getScale(x)) || {
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)) || {
192
190
  x: 1,
193
191
  y: 1
194
192
  } : {
195
193
  x: 1,
196
194
  y: 1
197
- }, A = tt(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
198
- elements: l,
195
+ }, O = et(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
196
+ elements: c,
199
197
  rect: w,
200
198
  offsetParent: x,
201
- strategy: c
199
+ strategy: l
202
200
  }) : w);
203
201
  return {
204
- top: (m.top - A.top + p.top) / v.y,
205
- bottom: (A.bottom - m.bottom + p.bottom) / v.y,
206
- left: (m.left - A.left + p.left) / v.x,
207
- right: (A.right - m.right + p.right) / v.x
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
208
206
  };
209
207
  }
210
- const ne = async (t, e, n) => {
208
+ const ie = 50, ne = async (t, e, n) => {
211
209
  const {
212
210
  placement: i = "bottom",
213
211
  strategy: o = "absolute",
214
212
  middleware: r = [],
215
213
  platform: s
216
- } = n, l = r.filter(Boolean), c = await (s.isRTL == null ? void 0 : s.isRTL(e));
214
+ } = n, c = s.detectOverflow ? s : {
215
+ ...s,
216
+ detectOverflow: ee
217
+ }, l = await (s.isRTL == null ? void 0 : s.isRTL(e));
217
218
  let a = await s.getElementRects({
218
219
  reference: t,
219
220
  floating: e,
@@ -221,16 +222,19 @@ const ne = async (t, e, n) => {
221
222
  }), {
222
223
  x: h,
223
224
  y: u
224
- } = _t(a, i, c), d = i, f = {}, p = 0;
225
- for (let y = 0; y < l.length; y++) {
226
- var g;
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;
227
231
  const {
228
- name: m,
232
+ name: g,
229
233
  fn: w
230
- } = l[y], {
234
+ } = y, {
231
235
  x,
232
236
  y: v,
233
- data: A,
237
+ data: O,
234
238
  reset: b
235
239
  } = await w({
236
240
  x: h,
@@ -238,40 +242,34 @@ const ne = async (t, e, n) => {
238
242
  initialPlacement: i,
239
243
  placement: d,
240
244
  strategy: o,
241
- middlewareData: f,
245
+ middlewareData: p,
242
246
  rects: a,
243
- platform: {
244
- ...s,
245
- detectOverflow: (g = s.detectOverflow) != null ? g : ee
246
- },
247
+ platform: c,
247
248
  elements: {
248
249
  reference: t,
249
250
  floating: e
250
251
  }
251
252
  });
252
- h = x ?? h, u = v ?? u, f = {
253
- ...f,
254
- [m]: {
255
- ...f[m],
256
- ...A
257
- }
258
- }, b && p <= 50 && (p++, typeof b == "object" && (b.placement && (d = b.placement), b.rects && (a = b.rects === !0 ? await s.getElementRects({
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({
259
257
  reference: t,
260
258
  floating: e,
261
259
  strategy: o
262
260
  }) : b.rects), {
263
261
  x: h,
264
262
  y: u
265
- } = _t(a, d, c)), y = -1);
263
+ } = Ot(a, d, l)), m = -1);
266
264
  }
267
265
  return {
268
266
  x: h,
269
267
  y: u,
270
268
  placement: d,
271
269
  strategy: o,
272
- middlewareData: f
270
+ middlewareData: p
273
271
  };
274
- }, ie = function(t) {
272
+ }, oe = function(t) {
275
273
  return t === void 0 && (t = {}), {
276
274
  name: "flip",
277
275
  options: t,
@@ -281,8 +279,8 @@ const ne = async (t, e, n) => {
281
279
  placement: o,
282
280
  middlewareData: r,
283
281
  rects: s,
284
- initialPlacement: l,
285
- platform: c,
282
+ initialPlacement: c,
283
+ platform: l,
286
284
  elements: a
287
285
  } = e, {
288
286
  mainAxis: h = !0,
@@ -290,43 +288,43 @@ const ne = async (t, e, n) => {
290
288
  fallbackPlacements: d,
291
289
  fallbackStrategy: f = "bestFit",
292
290
  fallbackAxisSideDirection: p = "none",
293
- flipAlignment: g = !0,
291
+ flipAlignment: m = !0,
294
292
  ...y
295
- } = et(t, e);
293
+ } = it(t, e);
296
294
  if ((n = r.arrow) != null && n.alignmentOffset)
297
295
  return {};
298
- const m = W(o), w = F(l), x = W(l) === l, v = await (c.isRTL == null ? void 0 : c.isRTL(a.floating)), A = d || (x || !g ? [Z(l)] : qt(l)), b = p !== "none";
299
- !d && b && A.push(...Qt(l, g, p, v));
300
- const B = [l, ...A], lt = await c.detectOverflow(e, y), U = [];
301
- let z = ((i = r.flip) == null ? void 0 : i.overflows) || [];
302
- if (h && U.push(lt[m]), u) {
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) {
303
301
  const M = Yt(o, s, v);
304
- U.push(lt[M[0]], lt[M[1]]);
302
+ G.push(lt[M[0]], lt[M[1]]);
305
303
  }
306
- if (z = [...z, {
304
+ if (H = [...H, {
307
305
  placement: o,
308
- overflows: U
309
- }], !U.every((M) => M <= 0)) {
310
- var gt, yt;
311
- const M = (((gt = r.flip) == null ? void 0 : gt.index) || 0) + 1, ct = B[M];
312
- if (ct && (!(u === "alignment" ? w !== F(ct) : !1) || // We leave the current main axis only if every placement on that axis
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
313
311
  // overflows the main axis.
314
- z.every((C) => F(C.placement) === w ? C.overflows[0] > 0 : !0)))
312
+ H.every((C) => F(C.placement) === w ? C.overflows[0] > 0 : !0)))
315
313
  return {
316
314
  data: {
317
315
  index: M,
318
- overflows: z
316
+ overflows: H
319
317
  },
320
318
  reset: {
321
- placement: ct
319
+ placement: at
322
320
  }
323
321
  };
324
- let K = (yt = z.filter((V) => V.overflows[0] <= 0).sort((V, C) => V.overflows[1] - C.overflows[1])[0]) == null ? void 0 : yt.placement;
325
- if (!K)
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)
326
324
  switch (f) {
327
325
  case "bestFit": {
328
- var wt;
329
- const V = (wt = z.filter((C) => {
326
+ var vt;
327
+ const $ = (vt = H.filter((C) => {
330
328
  if (b) {
331
329
  const k = F(C.placement);
332
330
  return k === w || // Create a bias to the `y` side axis due to horizontal
@@ -334,31 +332,31 @@ const ne = async (t, e, n) => {
334
332
  k === "y";
335
333
  }
336
334
  return !0;
337
- }).map((C) => [C.placement, C.overflows.filter((k) => k > 0).reduce((k, Nt) => k + Nt, 0)]).sort((C, k) => C[1] - k[1])[0]) == null ? void 0 : wt[0];
338
- V && (K = V);
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 = $);
339
337
  break;
340
338
  }
341
339
  case "initialPlacement":
342
- K = l;
340
+ Y = c;
343
341
  break;
344
342
  }
345
- if (o !== K)
343
+ if (o !== Y)
346
344
  return {
347
345
  reset: {
348
- placement: K
346
+ placement: Y
349
347
  }
350
348
  };
351
349
  }
352
350
  return {};
353
351
  }
354
352
  };
355
- }, oe = /* @__PURE__ */ new Set(["left", "top"]);
356
- async function se(t, e) {
353
+ }, se = /* @__PURE__ */ new Set(["left", "top"]);
354
+ async function re(t, e) {
357
355
  const {
358
356
  placement: n,
359
357
  platform: i,
360
358
  elements: o
361
- } = t, r = await (i.isRTL == null ? void 0 : i.isRTL(o.floating)), s = W(n), l = nt(n), c = F(n) === "y", a = oe.has(s) ? -1 : 1, h = r && c ? -1 : 1, u = et(e, t);
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);
362
360
  let {
363
361
  mainAxis: d,
364
362
  crossAxis: f,
@@ -372,7 +370,7 @@ async function se(t, e) {
372
370
  crossAxis: u.crossAxis || 0,
373
371
  alignmentAxis: u.alignmentAxis
374
372
  };
375
- return l && typeof p == "number" && (f = l === "end" ? p * -1 : p), c ? {
373
+ return c && typeof p == "number" && (f = c === "end" ? p * -1 : p), l ? {
376
374
  x: f * h,
377
375
  y: d * a
378
376
  } : {
@@ -380,7 +378,7 @@ async function se(t, e) {
380
378
  y: f * h
381
379
  };
382
380
  }
383
- const re = function(t) {
381
+ const ce = function(t) {
384
382
  return t === void 0 && (t = 0), {
385
383
  name: "offset",
386
384
  options: t,
@@ -390,13 +388,13 @@ const re = function(t) {
390
388
  x: o,
391
389
  y: r,
392
390
  placement: s,
393
- middlewareData: l
394
- } = e, c = await se(e, t);
395
- return s === ((n = l.offset) == null ? void 0 : n.placement) && (i = l.arrow) != null && i.alignmentOffset ? {} : {
396
- x: o + c.x,
397
- y: r + c.y,
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,
398
396
  data: {
399
- ...c,
397
+ ...l,
400
398
  placement: s
401
399
  }
402
400
  };
@@ -414,13 +412,13 @@ const re = function(t) {
414
412
  platform: r
415
413
  } = e, {
416
414
  mainAxis: s = !0,
417
- crossAxis: l = !1,
418
- limiter: c = {
419
- fn: (m) => {
415
+ crossAxis: c = !1,
416
+ limiter: l = {
417
+ fn: (g) => {
420
418
  let {
421
419
  x: w,
422
420
  y: x
423
- } = m;
421
+ } = g;
424
422
  return {
425
423
  x: w,
426
424
  y: x
@@ -428,23 +426,23 @@ const re = function(t) {
428
426
  }
429
427
  },
430
428
  ...a
431
- } = et(t, e), h = {
429
+ } = it(t, e), h = {
432
430
  x: n,
433
431
  y: i
434
- }, u = await r.detectOverflow(e, a), d = F(W(o)), f = Tt(d);
435
- let p = h[f], g = h[d];
432
+ }, u = await r.detectOverflow(e, a), d = F(N(o)), f = St(d);
433
+ let p = h[f], m = h[d];
436
434
  if (s) {
437
- const m = f === "y" ? "top" : "left", w = f === "y" ? "bottom" : "right", x = p + u[m], v = p - u[w];
438
- p = xt(x, p, v);
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);
439
437
  }
440
- if (l) {
441
- const m = d === "y" ? "top" : "left", w = d === "y" ? "bottom" : "right", x = g + u[m], v = g - u[w];
442
- g = xt(x, g, v);
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);
443
441
  }
444
- const y = c.fn({
442
+ const y = l.fn({
445
443
  ...e,
446
444
  [f]: p,
447
- [d]: g
445
+ [d]: m
448
446
  });
449
447
  return {
450
448
  ...y,
@@ -453,91 +451,91 @@ const re = function(t) {
453
451
  y: y.y - i,
454
452
  enabled: {
455
453
  [f]: s,
456
- [d]: l
454
+ [d]: c
457
455
  }
458
456
  }
459
457
  };
460
458
  }
461
459
  };
462
460
  };
463
- function it() {
461
+ function ot() {
464
462
  return typeof window < "u";
465
463
  }
466
- function X(t) {
467
- return Pt(t) ? (t.nodeName || "").toLowerCase() : "#document";
464
+ function K(t) {
465
+ return Ft(t) ? (t.nodeName || "").toLowerCase() : "#document";
468
466
  }
469
467
  function _(t) {
470
468
  var e;
471
469
  return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
472
470
  }
473
- function P(t) {
471
+ function S(t) {
474
472
  var e;
475
- return (e = (Pt(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
473
+ return (e = (Ft(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
476
474
  }
477
- function Pt(t) {
478
- return it() ? t instanceof Node || t instanceof _(t).Node : !1;
475
+ function Ft(t) {
476
+ return ot() ? t instanceof Node || t instanceof _(t).Node : !1;
479
477
  }
480
- function R(t) {
481
- return it() ? t instanceof Element || t instanceof _(t).Element : !1;
478
+ function A(t) {
479
+ return ot() ? t instanceof Element || t instanceof _(t).Element : !1;
482
480
  }
483
- function E(t) {
484
- return it() ? t instanceof HTMLElement || t instanceof _(t).HTMLElement : !1;
481
+ function P(t) {
482
+ return ot() ? t instanceof HTMLElement || t instanceof _(t).HTMLElement : !1;
485
483
  }
486
- function Ot(t) {
487
- return !it() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof _(t).ShadowRoot;
484
+ function Ct(t) {
485
+ return !ot() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof _(t).ShadowRoot;
488
486
  }
489
- const ce = /* @__PURE__ */ new Set(["inline", "contents"]);
490
- function q(t) {
487
+ function U(t) {
491
488
  const {
492
489
  overflow: e,
493
490
  overflowX: n,
494
491
  overflowY: i,
495
492
  display: o
496
- } = S(t);
497
- return /auto|scroll|overlay|hidden|clip/.test(e + i + n) && !ce.has(o);
493
+ } = T(t);
494
+ return /auto|scroll|overlay|hidden|clip/.test(e + i + n) && o !== "inline" && o !== "contents";
498
495
  }
499
- const ae = /* @__PURE__ */ new Set(["table", "td", "th"]);
500
- function fe(t) {
501
- return ae.has(X(t));
496
+ function ae(t) {
497
+ return /^(table|td|th)$/.test(K(t));
502
498
  }
503
- const ue = [":popover-open", ":modal"];
504
- function ot(t) {
505
- return ue.some((e) => {
506
- try {
507
- return t.matches(e);
508
- } catch {
509
- return !1;
510
- }
511
- });
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
+ }
512
510
  }
513
- const he = ["transform", "translate", "scale", "rotate", "perspective"], de = ["transform", "translate", "scale", "rotate", "perspective", "filter"], pe = ["paint", "layout", "strict", "content"];
514
- function dt(t) {
515
- const e = pt(), n = R(t) ? S(t) : t;
516
- return he.some((i) => n[i] ? n[i] !== "none" : !1) || (n.containerType ? n.containerType !== "normal" : !1) || !e && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !e && (n.filter ? n.filter !== "none" : !1) || de.some((i) => (n.willChange || "").includes(i)) || pe.some((i) => (n.contain || "").includes(i));
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 || "");
517
516
  }
518
- function me(t) {
517
+ function he(t) {
519
518
  let e = D(t);
520
- for (; E(e) && !I(e); ) {
521
- if (dt(e))
519
+ for (; P(e) && !X(e); ) {
520
+ if (gt(e))
522
521
  return e;
523
- if (ot(e))
522
+ if (st(e))
524
523
  return null;
525
524
  e = D(e);
526
525
  }
527
526
  return null;
528
527
  }
529
- function pt() {
530
- return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
528
+ function mt() {
529
+ return ft == null && (ft = typeof CSS < "u" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none")), ft;
531
530
  }
532
- const ge = /* @__PURE__ */ new Set(["html", "body", "#document"]);
533
- function I(t) {
534
- return ge.has(X(t));
531
+ function X(t) {
532
+ return /^(html|body|#document)$/.test(K(t));
535
533
  }
536
- function S(t) {
534
+ function T(t) {
537
535
  return _(t).getComputedStyle(t);
538
536
  }
539
- function st(t) {
540
- return R(t) ? {
537
+ function rt(t) {
538
+ return A(t) ? {
541
539
  scrollLeft: t.scrollLeft,
542
540
  scrollTop: t.scrollTop
543
541
  } : {
@@ -546,157 +544,157 @@ function st(t) {
546
544
  };
547
545
  }
548
546
  function D(t) {
549
- if (X(t) === "html")
547
+ if (K(t) === "html")
550
548
  return t;
551
549
  const e = (
552
550
  // Step into the shadow DOM of the parent of a slotted node.
553
551
  t.assignedSlot || // DOM Element detected.
554
552
  t.parentNode || // ShadowRoot detected.
555
- Ot(t) && t.host || // Fallback.
556
- P(t)
553
+ Ct(t) && t.host || // Fallback.
554
+ S(t)
557
555
  );
558
- return Ot(e) ? e.host : e;
556
+ return Ct(e) ? e.host : e;
559
557
  }
560
- function kt(t) {
558
+ function Dt(t) {
561
559
  const e = D(t);
562
- return I(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : E(e) && q(e) ? e : kt(e);
560
+ return X(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : P(e) && U(e) ? e : Dt(e);
563
561
  }
564
- function Y(t, e, n) {
562
+ function q(t, e, n) {
565
563
  var i;
566
564
  e === void 0 && (e = []), n === void 0 && (n = !0);
567
- const o = kt(t), r = o === ((i = t.ownerDocument) == null ? void 0 : i.body), s = _(o);
565
+ const o = Dt(t), r = o === ((i = t.ownerDocument) == null ? void 0 : i.body), s = _(o);
568
566
  if (r) {
569
- const l = ut(s);
570
- return e.concat(s, s.visualViewport || [], q(o) ? o : [], l && n ? Y(l) : []);
571
- }
572
- return e.concat(o, Y(o, [], n));
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));
573
571
  }
574
- function ut(t) {
572
+ function dt(t) {
575
573
  return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
576
574
  }
577
- function Ft(t) {
578
- const e = S(t);
575
+ function Mt(t) {
576
+ const e = T(t);
579
577
  let n = parseFloat(e.width) || 0, i = parseFloat(e.height) || 0;
580
- const o = E(t), r = o ? t.offsetWidth : n, s = o ? t.offsetHeight : i, l = Q(n) !== r || Q(i) !== s;
581
- return l && (n = r, i = s), {
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), {
582
580
  width: n,
583
581
  height: i,
584
- $: l
582
+ $: c
585
583
  };
586
584
  }
587
- function mt(t) {
588
- return R(t) ? t : t.contextElement;
585
+ function yt(t) {
586
+ return A(t) ? t : t.contextElement;
589
587
  }
590
- function H(t) {
591
- const e = mt(t);
592
- if (!E(e))
588
+ function I(t) {
589
+ const e = yt(t);
590
+ if (!P(e))
593
591
  return L(1);
594
592
  const n = e.getBoundingClientRect(), {
595
593
  width: i,
596
594
  height: o,
597
595
  $: r
598
- } = Ft(e);
599
- let s = (r ? Q(n.width) : n.width) / i, l = (r ? Q(n.height) : n.height) / o;
600
- return (!s || !Number.isFinite(s)) && (s = 1), (!l || !Number.isFinite(l)) && (l = 1), {
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), {
601
599
  x: s,
602
- y: l
600
+ y: c
603
601
  };
604
602
  }
605
- const ye = /* @__PURE__ */ L(0);
606
- function Dt(t) {
603
+ const de = /* @__PURE__ */ L(0);
604
+ function $t(t) {
607
605
  const e = _(t);
608
- return !pt() || !e.visualViewport ? ye : {
606
+ return !mt() || !e.visualViewport ? de : {
609
607
  x: e.visualViewport.offsetLeft,
610
608
  y: e.visualViewport.offsetTop
611
609
  };
612
610
  }
613
- function we(t, e, n) {
611
+ function pe(t, e, n) {
614
612
  return e === void 0 && (e = !1), !n || e && n !== _(t) ? !1 : e;
615
613
  }
616
- function N(t, e, n, i) {
614
+ function B(t, e, n, i) {
617
615
  e === void 0 && (e = !1), n === void 0 && (n = !1);
618
- const o = t.getBoundingClientRect(), r = mt(t);
616
+ const o = t.getBoundingClientRect(), r = yt(t);
619
617
  let s = L(1);
620
- e && (i ? R(i) && (s = H(i)) : s = H(t));
621
- const l = we(r, n, i) ? Dt(r) : L(0);
622
- let c = (o.left + l.x) / s.x, a = (o.top + l.y) / s.y, h = o.width / s.x, u = o.height / s.y;
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;
623
621
  if (r) {
624
- const d = _(r), f = i && R(i) ? _(i) : i;
625
- let p = d, g = ut(p);
626
- for (; g && i && f !== p; ) {
627
- const y = H(g), m = g.getBoundingClientRect(), w = S(g), x = m.left + (g.clientLeft + parseFloat(w.paddingLeft)) * y.x, v = m.top + (g.clientTop + parseFloat(w.paddingTop)) * y.y;
628
- c *= y.x, a *= y.y, h *= y.x, u *= y.y, c += x, a += v, p = _(g), g = ut(p);
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);
629
627
  }
630
628
  }
631
- return tt({
629
+ return et({
632
630
  width: h,
633
631
  height: u,
634
- x: c,
632
+ x: l,
635
633
  y: a
636
634
  });
637
635
  }
638
- function rt(t, e) {
639
- const n = st(t).scrollLeft;
640
- return e ? e.left + n : N(P(t)).left + n;
636
+ function ct(t, e) {
637
+ const n = rt(t).scrollLeft;
638
+ return e ? e.left + n : B(S(t)).left + n;
641
639
  }
642
- function Mt(t, e) {
643
- const n = t.getBoundingClientRect(), i = n.left + e.scrollLeft - rt(t, n), o = n.top + e.scrollTop;
640
+ function Vt(t, e) {
641
+ const n = t.getBoundingClientRect(), i = n.left + e.scrollLeft - ct(t, n), o = n.top + e.scrollTop;
644
642
  return {
645
643
  x: i,
646
644
  y: o
647
645
  };
648
646
  }
649
- function xe(t) {
647
+ function ge(t) {
650
648
  let {
651
649
  elements: e,
652
650
  rect: n,
653
651
  offsetParent: i,
654
652
  strategy: o
655
653
  } = t;
656
- const r = o === "fixed", s = P(i), l = e ? ot(e.floating) : !1;
657
- if (i === s || l && r)
654
+ const r = o === "fixed", s = S(i), c = e ? st(e.floating) : !1;
655
+ if (i === s || c && r)
658
656
  return n;
659
- let c = {
657
+ let l = {
660
658
  scrollLeft: 0,
661
659
  scrollTop: 0
662
660
  }, a = L(1);
663
- const h = L(0), u = E(i);
664
- if ((u || !u && !r) && ((X(i) !== "body" || q(s)) && (c = st(i)), E(i))) {
665
- const f = N(i);
666
- a = H(i), h.x = f.x + i.clientLeft, h.y = f.y + i.clientTop;
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;
667
665
  }
668
- const d = s && !u && !r ? Mt(s, c) : L(0);
666
+ const d = s && !u && !r ? Vt(s, l) : L(0);
669
667
  return {
670
668
  width: n.width * a.x,
671
669
  height: n.height * a.y,
672
- x: n.x * a.x - c.scrollLeft * a.x + h.x + d.x,
673
- y: n.y * a.y - c.scrollTop * a.y + h.y + d.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
674
672
  };
675
673
  }
676
- function ve(t) {
674
+ function me(t) {
677
675
  return Array.from(t.getClientRects());
678
676
  }
679
- function be(t) {
680
- const e = P(t), n = st(t), i = t.ownerDocument.body, o = $(e.scrollWidth, e.clientWidth, i.scrollWidth, i.clientWidth), r = $(e.scrollHeight, e.clientHeight, i.scrollHeight, i.clientHeight);
681
- let s = -n.scrollLeft + rt(t);
682
- const l = -n.scrollTop;
683
- return S(i).direction === "rtl" && (s += $(e.clientWidth, i.clientWidth) - o), {
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), {
684
682
  width: o,
685
683
  height: r,
686
684
  x: s,
687
- y: l
685
+ y: c
688
686
  };
689
687
  }
690
688
  const At = 25;
691
- function _e(t, e) {
692
- const n = _(t), i = P(t), o = n.visualViewport;
693
- let r = i.clientWidth, s = i.clientHeight, l = 0, c = 0;
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;
694
692
  if (o) {
695
693
  r = o.width, s = o.height;
696
- const h = pt();
697
- (!h || h && e === "fixed") && (l = o.offsetLeft, c = o.offsetTop);
694
+ const h = mt();
695
+ (!h || h && e === "fixed") && (c = o.offsetLeft, l = o.offsetTop);
698
696
  }
699
- const a = rt(i);
697
+ const a = ct(i);
700
698
  if (a <= 0) {
701
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);
702
700
  p <= At && (r -= p);
@@ -704,30 +702,29 @@ function _e(t, e) {
704
702
  return {
705
703
  width: r,
706
704
  height: s,
707
- x: l,
708
- y: c
705
+ x: c,
706
+ y: l
709
707
  };
710
708
  }
711
- const Oe = /* @__PURE__ */ new Set(["absolute", "fixed"]);
712
- function Ae(t, e) {
713
- const n = N(t, !0, e === "fixed"), i = n.top + t.clientTop, o = n.left + t.clientLeft, r = E(t) ? H(t) : L(1), s = t.clientWidth * r.x, l = t.clientHeight * r.y, c = o * r.x, a = i * r.y;
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;
714
711
  return {
715
712
  width: s,
716
- height: l,
717
- x: c,
713
+ height: c,
714
+ x: l,
718
715
  y: a
719
716
  };
720
717
  }
721
- function Ct(t, e, n) {
718
+ function Tt(t, e, n) {
722
719
  let i;
723
720
  if (e === "viewport")
724
- i = _e(t, n);
721
+ i = we(t, n);
725
722
  else if (e === "document")
726
- i = be(P(t));
727
- else if (R(e))
728
- i = Ae(e, n);
723
+ i = ye(S(t));
724
+ else if (A(e))
725
+ i = xe(e, n);
729
726
  else {
730
- const o = Dt(t);
727
+ const o = $t(t);
731
728
  i = {
732
729
  x: e.x - o.x,
733
730
  y: e.y - o.y,
@@ -735,70 +732,72 @@ function Ct(t, e, n) {
735
732
  height: e.height
736
733
  };
737
734
  }
738
- return tt(i);
735
+ return et(i);
739
736
  }
740
- function Vt(t, e) {
737
+ function Wt(t, e) {
741
738
  const n = D(t);
742
- return n === e || !R(n) || I(n) ? !1 : S(n).position === "fixed" || Vt(n, e);
739
+ return n === e || !A(n) || X(n) ? !1 : T(n).position === "fixed" || Wt(n, e);
743
740
  }
744
- function Ce(t, e) {
741
+ function ve(t, e) {
745
742
  const n = e.get(t);
746
743
  if (n)
747
744
  return n;
748
- let i = Y(t, [], !1).filter((l) => R(l) && X(l) !== "body"), o = null;
749
- const r = S(t).position === "fixed";
745
+ let i = q(t, [], !1).filter((c) => A(c) && K(c) !== "body"), o = null;
746
+ const r = T(t).position === "fixed";
750
747
  let s = r ? D(t) : t;
751
- for (; R(s) && !I(s); ) {
752
- const l = S(s), c = dt(s);
753
- !c && l.position === "fixed" && (o = null), (r ? !c && !o : !c && l.position === "static" && !!o && Oe.has(o.position) || q(s) && !c && Vt(t, s)) ? i = i.filter((h) => h !== s) : o = l, s = D(s);
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);
754
751
  }
755
752
  return e.set(t, i), i;
756
753
  }
757
- function Re(t) {
754
+ function be(t) {
758
755
  let {
759
756
  element: e,
760
757
  boundary: n,
761
758
  rootBoundary: i,
762
759
  strategy: o
763
760
  } = t;
764
- const s = [...n === "clippingAncestors" ? ot(e) ? [] : Ce(e, this._c) : [].concat(n), i], l = s[0], c = s.reduce((a, h) => {
765
- const u = Ct(e, h, o);
766
- return a.top = $(u.top, a.top), a.right = J(u.right, a.right), a.bottom = J(u.bottom, a.bottom), a.left = $(u.left, a.left), a;
767
- }, Ct(e, l, o));
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
+ }
768
767
  return {
769
- width: c.right - c.left,
770
- height: c.bottom - c.top,
771
- x: c.left,
772
- y: c.top
768
+ width: a - u,
769
+ height: h - l,
770
+ x: u,
771
+ y: l
773
772
  };
774
773
  }
775
- function Se(t) {
774
+ function _e(t) {
776
775
  const {
777
776
  width: e,
778
777
  height: n
779
- } = Ft(t);
778
+ } = Mt(t);
780
779
  return {
781
780
  width: e,
782
781
  height: n
783
782
  };
784
783
  }
785
- function Te(t, e, n) {
786
- const i = E(e), o = P(e), r = n === "fixed", s = N(t, !0, r, e);
787
- let l = {
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 = {
788
787
  scrollLeft: 0,
789
788
  scrollTop: 0
790
789
  };
791
- const c = L(0);
790
+ const l = L(0);
792
791
  function a() {
793
- c.x = rt(o);
792
+ l.x = ct(o);
794
793
  }
795
794
  if (i || !i && !r)
796
- if ((X(e) !== "body" || q(o)) && (l = st(e)), i) {
797
- const f = N(e, !0, r, e);
798
- c.x = f.x + e.clientLeft, c.y = f.y + e.clientTop;
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;
799
798
  } else o && a();
800
799
  r && !i && o && a();
801
- const h = o && !i && !r ? Mt(o, l) : L(0), u = s.left + l.scrollLeft - c.x - h.x, d = s.top + l.scrollTop - c.y - h.y;
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;
802
801
  return {
803
802
  x: u,
804
803
  y: d,
@@ -806,39 +805,39 @@ function Te(t, e, n) {
806
805
  height: s.height
807
806
  };
808
807
  }
809
- function at(t) {
810
- return S(t).position === "static";
808
+ function ut(t) {
809
+ return T(t).position === "static";
811
810
  }
812
- function Rt(t, e) {
813
- if (!E(t) || S(t).position === "fixed")
811
+ function Et(t, e) {
812
+ if (!P(t) || T(t).position === "fixed")
814
813
  return null;
815
814
  if (e)
816
815
  return e(t);
817
816
  let n = t.offsetParent;
818
- return P(t) === n && (n = n.ownerDocument.body), n;
817
+ return S(t) === n && (n = n.ownerDocument.body), n;
819
818
  }
820
- function $t(t, e) {
819
+ function Nt(t, e) {
821
820
  const n = _(t);
822
- if (ot(t))
821
+ if (st(t))
823
822
  return n;
824
- if (!E(t)) {
823
+ if (!P(t)) {
825
824
  let o = D(t);
826
- for (; o && !I(o); ) {
827
- if (R(o) && !at(o))
825
+ for (; o && !X(o); ) {
826
+ if (A(o) && !ut(o))
828
827
  return o;
829
828
  o = D(o);
830
829
  }
831
830
  return n;
832
831
  }
833
- let i = Rt(t, e);
834
- for (; i && fe(i) && at(i); )
835
- i = Rt(i, e);
836
- return i && I(i) && at(i) && !dt(i) ? n : i || me(t) || n;
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;
837
836
  }
838
- const Le = async function(t) {
839
- const e = this.getOffsetParent || $t, n = this.getDimensions, i = await n(t.floating);
837
+ const Oe = async function(t) {
838
+ const e = this.getOffsetParent || Nt, n = this.getDimensions, i = await n(t.floating);
840
839
  return {
841
- reference: Te(t.reference, await e(t.floating), t.strategy),
840
+ reference: Re(t.reference, await e(t.floating), t.strategy),
842
841
  floating: {
843
842
  x: 0,
844
843
  y: 0,
@@ -847,109 +846,109 @@ const Le = async function(t) {
847
846
  }
848
847
  };
849
848
  };
850
- function Ee(t) {
851
- return S(t).direction === "rtl";
852
- }
853
- const Pe = {
854
- convertOffsetParentRelativeRectToViewportRelativeRect: xe,
855
- getDocumentElement: P,
856
- getClippingRect: Re,
857
- getOffsetParent: $t,
858
- getElementRects: Le,
859
- getClientRects: ve,
860
- getDimensions: Se,
861
- getScale: H,
862
- isElement: R,
863
- isRTL: Ee
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
864
863
  };
865
- function Wt(t, e) {
864
+ function Bt(t, e) {
866
865
  return t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height;
867
866
  }
868
- function ke(t, e) {
867
+ function Te(t, e) {
869
868
  let n = null, i;
870
- const o = P(t);
869
+ const o = S(t);
871
870
  function r() {
872
- var l;
873
- clearTimeout(i), (l = n) == null || l.disconnect(), n = null;
871
+ var c;
872
+ clearTimeout(i), (c = n) == null || c.disconnect(), n = null;
874
873
  }
875
- function s(l, c) {
876
- l === void 0 && (l = !1), c === void 0 && (c = 1), r();
874
+ function s(c, l) {
875
+ c === void 0 && (c = !1), l === void 0 && (l = 1), r();
877
876
  const a = t.getBoundingClientRect(), {
878
877
  left: h,
879
878
  top: u,
880
879
  width: d,
881
880
  height: f
882
881
  } = a;
883
- if (l || e(), !d || !f)
882
+ if (c || e(), !d || !f)
884
883
  return;
885
- const p = G(u), g = G(o.clientWidth - (h + d)), y = G(o.clientHeight - (u + f)), m = G(h), x = {
886
- rootMargin: -p + "px " + -g + "px " + -y + "px " + -m + "px",
887
- threshold: $(0, J(1, c)) || 1
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
888
887
  };
889
888
  let v = !0;
890
- function A(b) {
891
- const B = b[0].intersectionRatio;
892
- if (B !== c) {
889
+ function O(b) {
890
+ const z = b[0].intersectionRatio;
891
+ if (z !== l) {
893
892
  if (!v)
894
893
  return s();
895
- B ? s(!1, B) : i = setTimeout(() => {
894
+ z ? s(!1, z) : i = setTimeout(() => {
896
895
  s(!1, 1e-7);
897
896
  }, 1e3);
898
897
  }
899
- B === 1 && !Wt(a, t.getBoundingClientRect()) && s(), v = !1;
898
+ z === 1 && !Bt(a, t.getBoundingClientRect()) && s(), v = !1;
900
899
  }
901
900
  try {
902
- n = new IntersectionObserver(A, {
901
+ n = new IntersectionObserver(O, {
903
902
  ...x,
904
903
  // Handle <iframe>s
905
904
  root: o.ownerDocument
906
905
  });
907
906
  } catch {
908
- n = new IntersectionObserver(A, x);
907
+ n = new IntersectionObserver(O, x);
909
908
  }
910
909
  n.observe(t);
911
910
  }
912
911
  return s(!0), r;
913
912
  }
914
- function Fe(t, e, n, i) {
913
+ function Ee(t, e, n, i) {
915
914
  i === void 0 && (i = {});
916
915
  const {
917
916
  ancestorScroll: o = !0,
918
917
  ancestorResize: r = !0,
919
918
  elementResize: s = typeof ResizeObserver == "function",
920
- layoutShift: l = typeof IntersectionObserver == "function",
921
- animationFrame: c = !1
922
- } = i, a = mt(t), h = o || r ? [...a ? Y(a) : [], ...Y(e)] : [];
923
- h.forEach((m) => {
924
- o && m.addEventListener("scroll", n, {
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, {
925
924
  passive: !0
926
- }), r && m.addEventListener("resize", n);
925
+ }), r && g.addEventListener("resize", n);
927
926
  });
928
- const u = a && l ? ke(a, n) : null;
927
+ const u = a && c ? Te(a, n) : null;
929
928
  let d = -1, f = null;
930
- s && (f = new ResizeObserver((m) => {
931
- let [w] = m;
932
- w && w.target === a && f && (f.unobserve(e), cancelAnimationFrame(d), d = requestAnimationFrame(() => {
929
+ s && (f = new ResizeObserver((g) => {
930
+ let [w] = g;
931
+ w && w.target === a && f && e && (f.unobserve(e), cancelAnimationFrame(d), d = requestAnimationFrame(() => {
933
932
  var x;
934
933
  (x = f) == null || x.observe(e);
935
934
  })), n();
936
- }), a && !c && f.observe(a), f.observe(e));
937
- let p, g = c ? N(t) : null;
938
- c && y();
935
+ }), a && !l && f.observe(a), e && f.observe(e));
936
+ let p, m = l ? B(t) : null;
937
+ l && y();
939
938
  function y() {
940
- const m = N(t);
941
- g && !Wt(g, m) && n(), g = m, p = requestAnimationFrame(y);
939
+ const g = B(t);
940
+ m && !Bt(m, g) && n(), m = g, p = requestAnimationFrame(y);
942
941
  }
943
942
  return n(), () => {
944
- var m;
943
+ var g;
945
944
  h.forEach((w) => {
946
945
  o && w.removeEventListener("scroll", n), r && w.removeEventListener("resize", n);
947
- }), u == null || u(), (m = f) == null || m.disconnect(), f = null, c && cancelAnimationFrame(p);
946
+ }), u == null || u(), (g = f) == null || g.disconnect(), f = null, l && cancelAnimationFrame(p);
948
947
  };
949
948
  }
950
- const De = re, Me = le, Ve = ie, $e = (t, e, n) => {
949
+ const Le = ce, Se = le, Pe = oe, ke = (t, e, n) => {
951
950
  const i = /* @__PURE__ */ new Map(), o = {
952
- platform: Pe,
951
+ platform: Ae,
953
952
  ...n
954
953
  }, r = {
955
954
  ...o.platform,
@@ -960,13 +959,13 @@ const De = re, Me = le, Ve = ie, $e = (t, e, n) => {
960
959
  platform: r
961
960
  });
962
961
  };
963
- var We = Object.defineProperty, Ne = Object.getOwnPropertyDescriptor, T = (t, e, n, i) => {
964
- for (var o = i > 1 ? void 0 : i ? Ne(e, n) : e, r = t.length - 1, s; r >= 0; r--)
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--)
965
964
  (s = t[r]) && (o = (i ? s(e, n, o) : s(o)) || o);
966
- return i && o && We(e, n, o), o;
965
+ return i && o && Fe(e, n, o), o;
967
966
  };
968
- const Be = "fhi-tooltip";
969
- let O = class extends zt {
967
+ const Me = "fhi-tooltip";
968
+ let R = class extends It {
970
969
  constructor() {
971
970
  super(...arguments), this.message = "", this.placement = "top", this.delay = 500, this.trigger = "hover", this.maxWidth = "18.75rem", this._timeoutId = void 0, this._autoPositioningCleanup = () => {
972
971
  }, this._isVisible = !1, this._isFadingOut = !1, this._position = {
@@ -978,6 +977,9 @@ let O = class extends zt {
978
977
  t.key === "Escape" && this._isVisible && this._hideTooltip();
979
978
  };
980
979
  }
980
+ update(t) {
981
+ t.has("trigger") && this.trigger !== "click" && this.trigger !== "hover" && (this.trigger = "hover"), super.update(t);
982
+ }
981
983
  _showTooltip() {
982
984
  this._isVisible || this.message && (this._positionTooltip(this.placement), this._isVisible = !0, window.addEventListener("click", this._handlePotentialClickOutside), window.addEventListener("keydown", this.__handlePotentialEscapeKeyPress));
983
985
  }
@@ -990,17 +992,17 @@ let O = class extends zt {
990
992
  }, 150));
991
993
  }
992
994
  _positionTooltip(t) {
993
- this._autoPositioningCleanup = Fe(
995
+ this._autoPositioningCleanup = Ee(
994
996
  this._anchor,
995
997
  this._tooltip,
996
998
  () => {
997
- $e(this._anchor, this._tooltip, {
998
- placement: t,
999
+ ke(this._anchor, this._tooltip, {
1000
+ placement: t || "top",
999
1001
  strategy: "fixed",
1000
1002
  middleware: [
1001
- Ve({ fallbackAxisSideDirection: "start" }),
1002
- Me(),
1003
- De(4)
1003
+ Pe({ fallbackAxisSideDirection: "start" }),
1004
+ Se(),
1005
+ Le(4)
1004
1006
  ]
1005
1007
  }).then(({ x: e, y: n }) => {
1006
1008
  this._position = {
@@ -1023,7 +1025,7 @@ let O = class extends zt {
1023
1025
  this.trigger === "click" && (this._isVisible ? this._hideTooltip() : this._showTooltip());
1024
1026
  }
1025
1027
  render() {
1026
- return Ht`
1028
+ return Xt`
1027
1029
  <div
1028
1030
  id="tooltip-anchor"
1029
1031
  @mouseenter=${this._handleMouseEnter}
@@ -1052,7 +1054,7 @@ let O = class extends zt {
1052
1054
  `;
1053
1055
  }
1054
1056
  };
1055
- O.styles = Bt`
1057
+ R.styles = Ht`
1056
1058
  :host {
1057
1059
  --color-background: var(--fhi-color-neutral-base-active);
1058
1060
  --color-text: var(--fhi-color-neutral-text-inverted);
@@ -1120,41 +1122,41 @@ O.styles = Bt`
1120
1122
  }
1121
1123
  }
1122
1124
  `;
1123
- T([
1125
+ E([
1124
1126
  j({ type: String })
1125
- ], O.prototype, "message", 2);
1126
- T([
1127
+ ], R.prototype, "message", 2);
1128
+ E([
1127
1129
  j({ type: String })
1128
- ], O.prototype, "placement", 2);
1129
- T([
1130
+ ], R.prototype, "placement", 2);
1131
+ E([
1130
1132
  j({ type: Number })
1131
- ], O.prototype, "delay", 2);
1132
- T([
1133
+ ], R.prototype, "delay", 2);
1134
+ E([
1133
1135
  j({ type: String })
1134
- ], O.prototype, "trigger", 2);
1135
- T([
1136
+ ], R.prototype, "trigger", 2);
1137
+ E([
1136
1138
  j({ type: String, attribute: "max-width" })
1137
- ], O.prototype, "maxWidth", 2);
1138
- T([
1139
- St("#tooltip-anchor")
1140
- ], O.prototype, "_anchor", 2);
1141
- T([
1142
- St("#tooltip")
1143
- ], O.prototype, "_tooltip", 2);
1144
- T([
1145
- ht()
1146
- ], O.prototype, "_isVisible", 2);
1147
- T([
1148
- ht()
1149
- ], O.prototype, "_isFadingOut", 2);
1150
- T([
1151
- ht()
1152
- ], O.prototype, "_position", 2);
1153
- O = T([
1154
- It(Be)
1155
- ], O);
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);
1156
1158
  export {
1157
- O as FhiTooltip,
1158
- Be as FhiTooltipSelector
1159
+ R as FhiTooltip,
1160
+ Me as FhiTooltipSelector
1159
1161
  };
1160
1162
  //# sourceMappingURL=fhi-tooltip.js.map